Commit 1d3c88cd authored by matzakos's avatar matzakos

Fixed some warnings and removed redundant files.

parent ea33b914
...@@ -2001,6 +2001,8 @@ add_executable(lte-softmodem ...@@ -2001,6 +2001,8 @@ add_executable(lte-softmodem
${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
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.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
...@@ -2143,96 +2145,6 @@ target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt cry ...@@ -2143,96 +2145,6 @@ target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt cry
target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB}) target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
# lte-softmodem-stub-nos1 is both eNB and UE implementation
###################################################
add_executable(lte-softmodem-stub-nos1
${rrc_h}
${s1ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-stub.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
#${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
#${GTPU_need_ITTI}
#${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
target_link_libraries (lte-softmodem-stub-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB
-Wl,--end-group z dl)
target_link_libraries (lte-softmodem-stub-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-stub-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-stub-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-stub-nos1 ${T_LIB})
# lte-softmodem-stub is both eNB and UE implementation
###################################################
add_executable(lte-softmodem-stub
${rrc_h}
${s1ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-enb.c
${OPENAIR_TARGETS}/RT/USER/lte-softmodem-stub.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
#${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
target_link_libraries (lte-softmodem-stub
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB
-Wl,--end-group z dl)
target_link_libraries (lte-softmodem-stub ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-stub pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem-stub ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-stub ${T_LIB})
# USIM process # USIM process
...@@ -2471,7 +2383,7 @@ endforeach(myExe) ...@@ -2471,7 +2383,7 @@ endforeach(myExe)
if (${T_TRACER}) if (${T_TRACER})
foreach(i foreach(i
#all "add_executable" definitions (except tests, rb_tool, updatefw) #all "add_executable" definitions (except tests, rb_tool, updatefw)
lte-softmodem lte-softmodem-stub lte-softmodem-nos1 oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 oaisim oaisim_nos1
dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim
pdcchsim pucchsim prachsim syncsim pdcchsim pucchsim prachsim syncsim
......
...@@ -499,14 +499,6 @@ function main() { ...@@ -499,14 +499,6 @@ 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
#<<<<<<< HEAD
# #lte_exec=lte-softmodem-nos1
# lte_exec=lte-softmodem-stub-nos1
# else
# lte_build_dir=lte_build_oai
# #lte_exec=lte-softmodem
# lte_exec=lte-softmodem-stub
#=======
if [ "$eNB" = "1" ] ; then if [ "$eNB" = "1" ] ; then
lte_exec=lte-softmodem-nos1 lte_exec=lte-softmodem-nos1
fi fi
...@@ -521,7 +513,6 @@ function main() { ...@@ -521,7 +513,6 @@ function main() {
if [ "$UE" = "1" ] ; then if [ "$UE" = "1" ] ; then
lte_exec=lte-uesoftmodem lte_exec=lte-uesoftmodem
fi fi
#>>>>>>> main/develop
fi fi
# configuration module libraries, one currently available, using libconfig # configuration module libraries, one currently available, using libconfig
......
...@@ -1832,7 +1832,6 @@ static uint8_t pack_crc_indication_body_value(void* tlv, uint8_t **ppWritePacked ...@@ -1832,7 +1832,6 @@ static uint8_t pack_crc_indication_body_value(void* tlv, uint8_t **ppWritePacked
nfapi_crc_indication_body_t* value = (nfapi_crc_indication_body_t*)tlv; nfapi_crc_indication_body_t* value = (nfapi_crc_indication_body_t*)tlv;
if(push16(value->number_of_crcs, ppWritePackedMsg, end) == 0){ if(push16(value->number_of_crcs, ppWritePackedMsg, end) == 0){
printf("Panos-D: pack_crc_indication_body_value 0 \n");
return 0; return 0;
} }
...@@ -1844,13 +1843,11 @@ static uint8_t pack_crc_indication_body_value(void* tlv, uint8_t **ppWritePacked ...@@ -1844,13 +1843,11 @@ static uint8_t pack_crc_indication_body_value(void* tlv, uint8_t **ppWritePacked
uint8_t* instance_length_p = *ppWritePackedMsg; uint8_t* instance_length_p = *ppWritePackedMsg;
if(!push16(pdu->instance_length, ppWritePackedMsg, end)){ if(!push16(pdu->instance_length, ppWritePackedMsg, end)){
printf("Panos-D: pack_crc_indication_body_value 1 \n");
return 0; return 0;
} }
if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) && if(!(pack_tlv(NFAPI_RX_UE_INFORMATION_TAG, &pdu->rx_ue_information, ppWritePackedMsg, end, pack_rx_ue_information_value) &&
pack_tlv(NFAPI_CRC_INDICATION_REL8_TAG, &pdu->crc_indication_rel8, ppWritePackedMsg, end, pack_crc_indication_rel8_body))){ pack_tlv(NFAPI_CRC_INDICATION_REL8_TAG, &pdu->crc_indication_rel8, ppWritePackedMsg, end, pack_crc_indication_rel8_body))){
printf("Panos-D: pack_crc_indication_body_value 2 \n");
return 0; return 0;
} }
...@@ -1965,7 +1962,6 @@ static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWriteP ...@@ -1965,7 +1962,6 @@ static uint8_t pack_rx_ulsch_indication_body_value(void *tlv, uint8_t **ppWriteP
} }
if( pusharray8(value->rx_pdu_list[i].data, length, length, ppWritePackedMsg, end) == 0){ if( pusharray8(value->rx_pdu_list[i].data, length, length, ppWritePackedMsg, end) == 0){
printf("Panos-D: pack_rx_ulsch_indication_body_value() 2 about to return error \n");
return 0; return 0;
} }
} }
...@@ -2788,7 +2784,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu ...@@ -2788,7 +2784,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
pMessageHeader->message_length = packedMsgLen16; pMessageHeader->message_length = packedMsgLen16;
if(!push16(packedMsgLen16, &pPackedLengthField, end)){ if(!push16(packedMsgLen16, &pPackedLengthField, end)){
printf("Panos-D: Pack function failed. Returning... \n"); //printf("Panos-D: Pack function failed. Returning... \n");
return -1; return -1;
} }
...@@ -2797,7 +2793,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu ...@@ -2797,7 +2793,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
//quick test //quick test
if(pMessageHeader->message_length != packedMsgLen) if(pMessageHeader->message_length != packedMsgLen)
{ {
printf("Panos-D: nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id); //printf("Panos-D: nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id); NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi packedMsgLen(%d) != message_length(%d) id %d\n", packedMsgLen, pMessageHeader->message_length, pMessageHeader->message_id);
} }
} }
......
...@@ -416,14 +416,14 @@ int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t len) ...@@ -416,14 +416,14 @@ int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t len)
int sendto_result; int sendto_result;
if ((sendto_result = sendto((int)pnf_p7->p7_sock, (const char*)msg, len, 0, (const struct sockaddr*)&remote_addr, remote_addr_len)) < 0) if ((sendto_result = sendto((int)pnf_p7->p7_sock, (const char*)msg, len, 0, (const struct sockaddr*)&remote_addr, remote_addr_len)) < 0)
{ {
printf("Panos-D: %s %s:%d sendto(%d, %p, %d) %d failed errno: %d\n", __FUNCTION__, pnf_p7->_public.remote_p7_addr, pnf_p7->_public.remote_p7_port, (int)pnf_p7->p7_sock, (const char*)msg, len, remote_addr_len, errno); //printf("Panos-D: %s %s:%d sendto(%d, %p, %d) %d failed errno: %d\n", __FUNCTION__, pnf_p7->_public.remote_p7_addr, pnf_p7->_public.remote_p7_port, (int)pnf_p7->p7_sock, (const char*)msg, len, remote_addr_len, errno);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s %s:%d sendto(%d, %p, %d) %d failed errno: %d\n", __FUNCTION__, pnf_p7->_public.remote_p7_addr, pnf_p7->_public.remote_p7_port, (int)pnf_p7->p7_sock, (const char*)msg, len, remote_addr_len, errno); NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s %s:%d sendto(%d, %p, %d) %d failed errno: %d\n", __FUNCTION__, pnf_p7->_public.remote_p7_addr, pnf_p7->_public.remote_p7_port, (int)pnf_p7->p7_sock, (const char*)msg, len, remote_addr_len, errno);
return -1; return -1;
} }
if(sendto_result != len) if(sendto_result != len)
{ {
printf("Panos-D: %s sendto failed to send the entire message %d %d\n", __FUNCTION__, sendto_result, len); //printf("Panos-D: %s sendto failed to send the entire message %d %d\n", __FUNCTION__, sendto_result, len);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s sendto failed to send the entire message %d %d\n", __FUNCTION__, sendto_result, len); NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s sendto failed to send the entire message %d %d\n", __FUNCTION__, sendto_result, len);
} }
return 0; return 0;
...@@ -436,7 +436,7 @@ int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* ...@@ -436,7 +436,7 @@ int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t*
// Need to guard against different threads calling the encode function at the same time // Need to guard against different threads calling the encode function at the same time
if(pthread_mutex_lock(&(pnf_p7->pack_mutex)) != 0) if(pthread_mutex_lock(&(pnf_p7->pack_mutex)) != 0)
{ {
printf("Panos-D: failed to lock mutex 1\n"); //printf("Panos-D: failed to lock mutex 1\n");
NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n"); NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to lock mutex\n");
return -1; return -1;
} }
...@@ -447,12 +447,12 @@ int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* ...@@ -447,12 +447,12 @@ int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t*
{ {
if(pthread_mutex_unlock(&(pnf_p7->pack_mutex)) != 0) if(pthread_mutex_unlock(&(pnf_p7->pack_mutex)) != 0)
{ {
printf("Panos-D: failed to unlock mutex 2\n"); //printf("Panos-D: failed to unlock mutex 2\n");
NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n"); NFAPI_TRACE(NFAPI_TRACE_INFO, "failed to unlock mutex\n");
return -1; return -1;
} }
printf("Panos-D: nfapi_p7_message_pack failed with return %d\n", len); //printf("Panos-D: nfapi_p7_message_pack failed with return %d\n", len);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p7_message_pack failed with return %d\n", len ); NFAPI_TRACE(NFAPI_TRACE_ERROR, "nfapi_p7_message_pack failed with return %d\n", len );
return -1; return -1;
} }
...@@ -466,7 +466,7 @@ int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t* ...@@ -466,7 +466,7 @@ int pnf_p7_pack_and_send_p7_message(pnf_p7_t* pnf_p7, nfapi_p7_message_header_t*
int segment = 0; int segment = 0;
int offset = NFAPI_P7_HEADER_LENGTH; int offset = NFAPI_P7_HEADER_LENGTH;
uint8_t buffer[pnf_p7->_public.segment_size]; uint8_t buffer[pnf_p7->_public.segment_size];
printf("Panos-D: pnf_p7_pack_and_send_p7_message sending through multiple segments \n"); //printf("Panos-D: pnf_p7_pack_and_send_p7_message sending through multiple segments \n");
for(segment = 0; segment < segment_count; ++segment) for(segment = 0; segment < segment_count; ++segment)
{ {
uint8_t last = 0; uint8_t last = 0;
...@@ -826,7 +826,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf) ...@@ -826,7 +826,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
} }
else if(pnf_p7->_public.timing_info_mode_aperiodic && pnf_p7->timing_info_aperiodic_send) else if(pnf_p7->_public.timing_info_mode_aperiodic && pnf_p7->timing_info_aperiodic_send)
{ {
printf("Panos-D: Sending aperiodic timing info message \n"); printf("Sending aperiodic timing info message \n");
pnf_pack_and_send_timing_info(pnf_p7); pnf_pack_and_send_timing_info(pnf_p7);
pnf_p7->timing_info_aperiodic_send = 0; pnf_p7->timing_info_aperiodic_send = 0;
...@@ -1369,7 +1369,7 @@ void pnf_handle_dl_node_sync(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, u ...@@ -1369,7 +1369,7 @@ void pnf_handle_dl_node_sync(void *pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7, u
// unpack the message // unpack the message
if (nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &dl_node_sync, sizeof(dl_node_sync), &pnf_p7->_public.codec_config) < 0) if (nfapi_p7_message_unpack(pRecvMsg, recvMsgLen, &dl_node_sync, sizeof(dl_node_sync), &pnf_p7->_public.codec_config) < 0)
{ {
printf("Panos-D: %s: Unpack message failed, ignoring\n", __FUNCTION__); //printf("Panos-D: %s: Unpack message failed, ignoring\n", __FUNCTION__);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__); NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Unpack message failed, ignoring\n", __FUNCTION__);
return; return;
} }
......
...@@ -117,7 +117,6 @@ int nfapi_pnf_p7_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_crc_indication_t* ...@@ -117,7 +117,6 @@ int nfapi_pnf_p7_crc_ind(nfapi_pnf_p7_config_t* config, nfapi_crc_indication_t*
{ {
if(config == NULL || ind == NULL) if(config == NULL || ind == NULL)
{ {
printf("Panos-D: %s: invalid input params\n", __FUNCTION__);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__); NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1; return -1;
} }
...@@ -129,7 +128,6 @@ int nfapi_pnf_p7_rx_ind(nfapi_pnf_p7_config_t* config, nfapi_rx_indication_t* in ...@@ -129,7 +128,6 @@ int nfapi_pnf_p7_rx_ind(nfapi_pnf_p7_config_t* config, nfapi_rx_indication_t* in
{ {
if(config == NULL || ind == NULL) if(config == NULL || ind == NULL)
{ {
printf("Panos-D: %s: invalid input params\n", __FUNCTION__);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__); NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1; return -1;
} }
......
...@@ -370,8 +370,6 @@ void phy_cleanup(void); ...@@ -370,8 +370,6 @@ void phy_cleanup(void);
void phy_config_request(PHY_Config_t *phy_config); void phy_config_request(PHY_Config_t *phy_config);
void phy_config_request_ue(UE_PHY_Config_t* UE_config_INFO);
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
......
...@@ -1278,7 +1278,7 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX ...@@ -1278,7 +1278,7 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
int32_t IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2]; int32_t IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2];
int32_t IP_allavg[D_NPUCCH_SF5]; int32_t IP_allavg[D_NPUCCH_SF5];
//int16_t temp_ch[2]; //int16_t temp_ch[2];
int16_t m[NUMBER_OF_UE_MAX], m_self, same_m_number; int16_t m[NUMBER_OF_UE_MAX], m_self=0, same_m_number;
uint16_t n3_pucch_sameRB[NUMBER_OF_UE_MAX]; uint16_t n3_pucch_sameRB[NUMBER_OF_UE_MAX];
int16_t n_oc0[NUMBER_OF_UE_MAX]; int16_t n_oc0[NUMBER_OF_UE_MAX];
int16_t n_oc1[NUMBER_OF_UE_MAX]; int16_t n_oc1[NUMBER_OF_UE_MAX];
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define __LTE_TRANSPORT_SLSS__C__ #define __LTE_TRANSPORT_SLSS__C__
#include "PHY/defs.h" #include "PHY/defs.h"
extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx) { void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx) {
......
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
#define __LTE_TRANSPORT_SLSS__C__ #define __LTE_TRANSPORT_SLSS__C__
#include "PHY/defs.h" #include "PHY/defs.h"
extern int
multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
void generate_slsch(PHY_VARS_UE *ue,SLSCH_t *slsch,int frame_tx,int subframe_tx) { void generate_slsch(PHY_VARS_UE *ue,SLSCH_t *slsch,int frame_tx,int subframe_tx) {
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#include "msc.h" #include "msc.h"
#include "openair2/PHY_INTERFACE/IF_Module.h" #include "openair2/PHY_INTERFACE/IF_Module.h"
#include "openair2/PHY_INTERFACE/IF_Module_UE.h" //#include "openair2/PHY_INTERFACE/IF_Module_UE.h"
//#include <complex.h> //#include <complex.h>
#include "assertions.h" #include "assertions.h"
...@@ -1434,12 +1434,6 @@ typedef struct { ...@@ -1434,12 +1434,6 @@ typedef struct {
/// N0 (used for abstraction) /// N0 (used for abstraction)
double N0; double N0;
/// Panos: Pointer to IF_Module_UE instance of the UE.
IF_Module_UE_t *if_inst_ue;
/// Panos: Pointer to DL.indication structure of the UE.
UE_DL_IND_t UE_DL_INFO;
/// PDSCH Varaibles /// PDSCH Varaibles
PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX]; PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_CONNECTED_eNB_MAX];
......
...@@ -1169,8 +1169,8 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1169,8 +1169,8 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
LTE_eNB_ULSCH_t *ulsch; LTE_eNB_ULSCH_t *ulsch;
LTE_UL_eNB_HARQ_t *ulsch_harq; LTE_UL_eNB_HARQ_t *ulsch_harq;
struct timespec t_decode, t_crc,t_rx_ind,t_rx_ind_b,t_harq_a,t_harq_b,t_end; struct timespec t_harq_a,t_harq_b;
//struct timespec t_decode, t_crc,t_rx_ind,t_rx_ind_b, t_end;
const int subframe = proc->subframe_rx; const int subframe = proc->subframe_rx;
const int frame = proc->frame_rx; const int frame = proc->frame_rx;
......
...@@ -2769,53 +2769,6 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ...@@ -2769,53 +2769,6 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PBCH_PROCEDURES, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PBCH_PROCEDURES, VCD_FUNCTION_OUT);
} }
// Panos: New function supporting the MAC interface
void fill_bch_indication(module_id_t module_idP,
frame_t frameP,
unsigned char eNB_index,
uint8_t first_sync,
uint8_t sync)
{
}
// Panos: New function supporting the MAC interface
void fill_dlsch_indication(module_id_t module_idP,
uint8_t CC_id,
frame_t frameP,
sub_frame_t subframeP,
uint8_t* sdu,
uint16_t sdu_len,
uint8_t eNB_index)
{
}
// Panos: New function supporting the MAC interface
void fill_dlsch_rar_indication(module_id_t module_idP,
int CC_id,
frame_t frameP,
rnti_t ra_rnti,
uint8_t* dlsch_buffer,
rnti_t* t_crnti,
uint8_t preamble_index,
uint8_t* selected_rar_buffer)
{
}
// PANOS: New function supporting the MAC interface
void fill_Tx_indication(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id, uint8_t Tx_ind_type)
{
switch (Tx_ind_type)
{
case UE_MAC_Tx_IND_Msg1_TYPE:
break;
case UE_MAC_Tx_IND_Msg3_TYPE:
break;
}
}
int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t abstraction_flag) int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t abstraction_flag)
......
This diff is collapsed.
...@@ -3204,7 +3204,7 @@ SLSS_t *ue_get_slss(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t su ...@@ -3204,7 +3204,7 @@ SLSS_t *ue_get_slss(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t su
SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t subframe_tx) { SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t subframe_tx) {
UE_MAC_INST *ue = &UE_mac_inst[Mod_id]; //UE_MAC_INST *ue = &UE_mac_inst[Mod_id];
SLDCH_t *sldch = &UE_mac_inst[Mod_id].sldch; SLDCH_t *sldch = &UE_mac_inst[Mod_id].sldch;
// Panos: Ask TTN if we should be calling mac_rrc_data_req_ue() instead of mac_rrc_data_req() now! // Panos: Ask TTN if we should be calling mac_rrc_data_req_ue() instead of mac_rrc_data_req() now!
/*sldch->payload_length = mac_rrc_data_req(Mod_id, /*sldch->payload_length = mac_rrc_data_req(Mod_id,
...@@ -3222,7 +3222,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t ...@@ -3222,7 +3222,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
frame_tx, frame_tx,
SL_DISCOVERY, SL_DISCOVERY,
1, 1,
(char*)(sldch->payload), //&UE_mac_inst[Mod_id].SL_Discovery[0].Tx_buffer.Payload[0], (uint8_t*)(sldch->payload), //&UE_mac_inst[Mod_id].SL_Discovery[0].Tx_buffer.Payload[0],
0, //eNB_indexP 0, //eNB_indexP
0); 0);
...@@ -3240,7 +3240,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t ...@@ -3240,7 +3240,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) { SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) {
mac_rlc_status_resp_t rlc_status, rlc_status_data; mac_rlc_status_resp_t rlc_status; //, rlc_status_data;
uint32_t absSF = (frameP*10)+subframeP; uint32_t absSF = (frameP*10)+subframeP;
UE_MAC_INST *ue = &UE_mac_inst[module_idP]; UE_MAC_INST *ue = &UE_mac_inst[module_idP];
int rvtab[4] = {0,2,3,1}; int rvtab[4] = {0,2,3,1};
......
...@@ -469,7 +469,7 @@ int pdcp_pc5_sockfd; ...@@ -469,7 +469,7 @@ int pdcp_pc5_sockfd;
struct sockaddr_in prose_ctrl_addr; struct sockaddr_in prose_ctrl_addr;
struct sockaddr_in prose_pdcp_addr; struct sockaddr_in prose_pdcp_addr;
struct sockaddr_in pdcp_sin; struct sockaddr_in pdcp_sin;
int pdcp_pc5_socket_init(); void pdcp_pc5_socket_init(void);
typedef struct { typedef struct {
rb_id_t rb_id; rb_id_t rb_id;
......
...@@ -487,13 +487,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -487,13 +487,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
#ifdef Rel14 #ifdef Rel14
int prose_addr_len; int prose_addr_len;
char send_buf[BUFSIZE], receive_buf[BUFSIZE]; char send_buf[BUFSIZE], receive_buf[BUFSIZE];
int optval; // Panos: Remove the following definitions due to warnings of unused variables.
//int optval;
int bytes_received; int bytes_received;
sidelink_pc5s_element *sl_pc5s_msg_recv = NULL; sidelink_pc5s_element *sl_pc5s_msg_recv = NULL;
sidelink_pc5s_element *sl_pc5s_msg_send = NULL; sidelink_pc5s_element *sl_pc5s_msg_send = NULL;
uint32_t sourceL2Id; //uint32_t sourceL2Id;
uint32_t groupL2Id; //uint32_t groupL2Id;
module_id_t module_id = 0; //module_id_t module_id = 0;
pc5s_header_t *pc5s_header; pc5s_header_t *pc5s_header;
#endif #endif
...@@ -633,7 +634,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -633,7 +634,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
// receive a message from ProSe App // receive a message from ProSe App
memset(receive_buf, 0, BUFSIZE); memset(receive_buf, 0, BUFSIZE);
bytes_received = recvfrom(pdcp_pc5_sockfd, receive_buf, BUFSIZE, 0, bytes_received = recvfrom(pdcp_pc5_sockfd, receive_buf, BUFSIZE, 0,
(struct sockaddr *) &prose_pdcp_addr, &prose_addr_len); (struct sockaddr *) &prose_pdcp_addr, (socklen_t *)&prose_addr_len);
// if (bytes_received < 0){ // if (bytes_received < 0){
// LOG_E(RRC, "ERROR: Failed to receive from ProSe App\n"); // LOG_E(RRC, "ERROR: Failed to receive from ProSe App\n");
// exit(EXIT_FAILURE); // exit(EXIT_FAILURE);
...@@ -720,7 +721,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -720,7 +721,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag); key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p); h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n", LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n",
key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id); (uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
} else { } else {
rab_id = rab_id % maxDRB; rab_id = rab_id % maxDRB;
LOG_I(PDCP, "PDCP_COLL_KEY_VALUE(module_id=%d, rnti=%x, enb_flag=%d, rab_id=%d, SRB_FLAG=%d)\n", LOG_I(PDCP, "PDCP_COLL_KEY_VALUE(module_id=%d, rnti=%x, enb_flag=%d, rab_id=%d, SRB_FLAG=%d)\n",
...@@ -728,7 +729,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -728,7 +729,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO); key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p); h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n", LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n",
key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id); (uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
} }
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
...@@ -1027,7 +1028,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -1027,7 +1028,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag); key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p); h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n", LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n",
key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id); (uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
} else { } else {
rab_id = rab_id % maxDRB; rab_id = rab_id % maxDRB;
LOG_I(PDCP, "PDCP_COLL_KEY_VALUE(module_id=%d, rnti=%x, enb_flag=%d, rab_id=%d, SRB_FLAG=%d)\n", LOG_I(PDCP, "PDCP_COLL_KEY_VALUE(module_id=%d, rnti=%x, enb_flag=%d, rab_id=%d, SRB_FLAG=%d)\n",
...@@ -1035,7 +1036,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -1035,7 +1036,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO); key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p); h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n", LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n",
key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id); (uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
} }
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
...@@ -1186,12 +1187,12 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP) ...@@ -1186,12 +1187,12 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
//TTN for D2D (PC5S) //TTN for D2D (PC5S)
#ifdef Rel14 #ifdef Rel14
int void
pdcp_pc5_socket_init() { pdcp_pc5_socket_init() {
pthread_attr_t attr; //pthread_attr_t attr;
struct sched_param sched_param; //struct sched_param sched_param;
int optval; // flag value for setsockopt int optval; // flag value for setsockopt
int n; // message byte size //int n; // message byte size
//create PDCP socket //create PDCP socket
pdcp_pc5_sockfd = socket(AF_INET, SOCK_DGRAM, 0); pdcp_pc5_sockfd = socket(AF_INET, SOCK_DGRAM, 0);
......
...@@ -69,6 +69,6 @@ extern void init_pdcp (struct pdcp_entity *pdcpP, struct rb_dispatcher *rbP, ...@@ -69,6 +69,6 @@ extern void init_pdcp (struct pdcp_entity *pdcpP, struct rb_dispatcher *rbP,
extern void *pdcp_tx (void *argP); extern void *pdcp_tx (void *argP);
#endif #endif
void pdcp_pc5_socket_init(); extern void pdcp_pc5_socket_init(void);
#endif #endif
#include "openair1/PHY/defs.h"
#include "openair2/PHY_INTERFACE/IF_Module_UE.h"
#include "openair2/PHY_INTERFACE/UE_MAC_interface.h"
#include "openair1/PHY/extern.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/proto.h"
#include "common/ran_context.h"
IF_Module_UE_t *if_inst_ue;
void handle_bch(UE_DL_IND_t *UE_DL_INFO)
{
}
void handle_dlsch(UE_DL_IND_t *UE_DL_INFO)
{
int i;
UE_MAC_dlsch_indication_pdu_t *dlsch_pdu_ind;
for (i=0; i<UE_DL_INFO->UE_DLSCH_ind.number_of_pdus; i++)
{
dlsch_pdu_ind = UE_DL_INFO->UE_DLSCH_ind.dlsch_ind_list[i];
switch (dlsch_pdu_ind->pdu_type) {
case UE_MAC_DL_IND_PDSCH_PDU_TYPE:
// Call ue_send_sdu()
break;
case UE_MAC_DL_IND_SI_PDSCH_PDU_TYPE:
// Call ue_decode_si()
break;
case UE_MAC_DL_IND_P_PDSCH_PDU_TYPE:
// Call ue_decode_p()
break;
case UE_MAC_DL_IND_DLSCH_RAR_PDU_TYPE:
// Call ue_process_rar()
break;
}
}
}
void UE_DL_indication(UE_DL_IND_t *UE_DL_INFO)
{
/*Call handle functions to forward PDUs or control indications to the upper layers.
handle_bch(UE_DL_INFO);
handle_dlsch (UE_DL_INFO);
Trigger ue_scheduler() ?
*/
}
/* Indicate the Txon of Msg1 or Msg3 to the MAC layer of the transmitter side and trigger associated
* MAC layer operations */
void UE_Tx_indication(UE_Tx_IND_t *UE_Tx_INFO)
{
switch (UE_Tx_INFO->ind_type) {
case UE_MAC_Tx_IND_Msg1_TYPE:
//Call Msg1_transmitted()
break;
case UE_MAC_Tx_IND_Msg3_TYPE:
//Call Msg3_transmitted()
break;
}
}
/// Panos: Not sure about the implementation of this function.
IF_Module_UE_t *IF_Module_ue_init(int Mod_id){
AssertFatal(Mod_id<MAX_MODULES,"Asking for Module %d > %d\n",Mod_id,MAX_IF_MODULES);
if (if_inst_ue[Mod_id]==NULL) {
if_inst_ue[Mod_id] = (IF_Module_t*)malloc(sizeof(IF_Module_t));
memset((void*)if_inst_ue[Mod_id],0,sizeof(IF_Module_t));
//if_inst_ue[Mod_id]->CC_mask=0;
if_inst_ue[Mod_id]->UE_DL_indication = UE_DL_indication;
if_inst_ue[Mod_id]->UE_Tx_indication = UE_Tx_indication;
// Panos: Have to check about this.
/*AssertFatal(pthread_mutex_init(&if_inst_ue[Mod_id]->if_mutex,NULL)==0,
"allocation of if_inst[%d]->if_mutex fails\n",Mod_id);*/
}
return if_inst[Mod_id];
}
/*This is the interface module between PHY
*Provided the FAPI style interface structures for P7.
*
*
*
*//*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file openair2/PHY_INTERFACE/IF_Module.h
* \brief data structures for PHY/MAC interface modules
* \author EURECOM/NTUST
* \date 2017
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __IF_MODULE_UE__H__
#define __IF_MODULE_UE__H__
#include <stdint.h>
#include "openair1/PHY/LTE_TRANSPORT/defs.h"
#include "UE_MAC_interface.h"
#define MAX_NUM_DL_PDU 100
#define MAX_NUM_UL_PDU 100
#define MAX_NUM_HI_DCI0_PDU 100
#define MAX_NUM_TX_REQUEST_PDU 100
#define MAX_NUM_HARQ_IND 100
#define MAX_NUM_CRC_IND 100
#define MAX_NUM_SR_IND 100
#define MAX_NUM_CQI_IND 100
#define MAX_NUM_RACH_IND 100
#define MAX_NUM_SRS_IND 100
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
int CC_id;
// / frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// harq ACKs indication list
//UE_MAC_hi_indication_body_t UE_hi_ind;
/// crc indication list
//UE_MAC_crc_indication_body_t UE_crc_ind;
/// RX BCH indication
UE_MAC_BCH_indication_body_t UE_BCH_ind;
/// RX DLSCH indication
UE_MAC_DLSCH_indication_body_t UE_DLSCH_ind;
} UE_DL_IND_t;
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
int CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// Txon Indication type (Msg1 or Msg3)
uint8_t ind_type;
}UE_Tx_IND_t;
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
int CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// Sidelink Control Information indication
ue_sci_indication_body_t UE_SCI_ind;
/// RX SLSCH indication
ue_SLSCH_indication_body_t UE_SLSCH_ind;
/// RX SLDCH indication
ue_SLDCH_indication_body_t UE_SLDCH_ind;
/// RX SLBCH indication
ue_SLBCH_indication_body_t UE_SLBCH_ind;
} UE_SL_IND_t;
// Downlink subframe P7
typedef struct{
/// Module ID
module_id_t module_id;
/// CC ID
uint8_t CC_id;
/// frame
frame_t frame;
/// subframe
sub_frame_t subframe;
/// UE_Mode to be filled only after
UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX];
/// MAC IFace UL Config Request
UE_MAC_ul_config_request_t *UE_UL_req;
/// MAC IFace SL Transmission Config Request
UE_MAC_sl_config_request_Tx_t *SL_Tx_req;
/// MAC IFace SL Reception Config Request
UE_MAC_sl_config_request_Rx_t *SL_Rx_req;
/// Pointers to UL SDUs
UE_MAC_tx_request_t *UE_TX_req;
/// Pointers to SL SDUs
UE_MAC_sl_tx_request_t *TX_SL_req;
}UE_Sched_Rsp_t;
typedef struct {
uint8_t Mod_id;
int CC_id;
UE_PHY_config_common_request_t *cfg_common;
UE_PHY_config_dedicated_request_t *cfg_dedicated;
}UE_PHY_Config_t;
typedef struct IF_Module_UE_s{
//define the function pointer
void (*UE_DL_indication)(UE_DL_IND_t *UE_DL_INFO);
void (*UE_SL_indication)(UE_SL_IND_t *UE_SL_INFO);
void (*UE_Tx_indication)(UE_Tx_IND_t *UE_Tx_INFO);
void (*UE_sched_response)(UE_Sched_Rsp_t *UE_Sched_INFO);
void (*UE_config_req)(UE_PHY_Config_t* UE_config_INFO);
//P: Perhaps an additional separate function for dedicated PHY configuration is needed.
//uint32_t CC_mask_ue;
uint16_t current_frame;
uint8_t current_subframe;
pthread_mutex_t if_mutex;
}IF_Module_UE_t;
IF_Module_UE_t *IF_Module_UE_init(int Mod_id);
void IF_Module_UE_kill(int Mod_id);
void UE_DL_indication(UE_DL_IND_t *UE_DL_INFO);
void UE_Tx_indication(UE_Tx_IND_t *UE_Tx_INFO);
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
void UE_schedule_response(UE_Sched_Rsp_t *UE_Sched_INFO);
#endif
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind); extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
...@@ -158,9 +160,6 @@ void fill_rach_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL ...@@ -158,9 +160,6 @@ void fill_rach_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL
pthread_mutex_lock(&UE_mac_inst[Mod_id].UL_INFO_mutex); pthread_mutex_lock(&UE_mac_inst[Mod_id].UL_INFO_mutex);
UL_INFO = (UL_IND_t*)malloc(sizeof(UL_IND_t)); UL_INFO = (UL_IND_t*)malloc(sizeof(UL_IND_t));
//LOG_I(MAC, "Panos-D: fill_rach_indication_UE_MAC 2 \n");
UL_INFO->rach_ind.rach_indication_body.number_of_preambles = 1; UL_INFO->rach_ind.rach_indication_body.number_of_preambles = 1;
//eNB->UL_INFO.rach_ind.preamble_list = &eNB->preamble_list[0]; //eNB->UL_INFO.rach_ind.preamble_list = &eNB->preamble_list[0];
...@@ -204,7 +203,6 @@ void fill_rach_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL ...@@ -204,7 +203,6 @@ void fill_rach_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL
} }
void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subframe, UL_IND_t *UL_INFO, uint16_t rnti) { void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subframe, UL_IND_t *UL_INFO, uint16_t rnti) {
//LOG_I(MAC, "Panos-D: fill_ulsch_cqi_indication_UE_MAC 1 \n");
pthread_mutex_lock(&UE_mac_inst[Mod_id].UL_INFO_mutex); pthread_mutex_lock(&UE_mac_inst[Mod_id].UL_INFO_mutex);
nfapi_cqi_indication_pdu_t *pdu = &UL_INFO->cqi_ind.cqi_pdu_list[UL_INFO->cqi_ind.number_of_cqis]; nfapi_cqi_indication_pdu_t *pdu = &UL_INFO->cqi_ind.cqi_pdu_list[UL_INFO->cqi_ind.number_of_cqis];
...@@ -300,11 +298,9 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id, ...@@ -300,11 +298,9 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id,
body->tl.tag = NFAPI_HARQ_INDICATION_BODY_TAG; body->tl.tag = NFAPI_HARQ_INDICATION_BODY_TAG;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG; pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
//LOG_I(MAC, "Panos-D: fill_uci_harq_indication_UE_MAC 2, # of harqs: %d \n", UL_INFO->harq_ind.harq_indication_body.number_of_harqs);
pdu->instance_length = 0; // don't know what to do with this pdu->instance_length = 0; // don't know what to do with this
// pdu->rx_ue_information.handle = handle; // pdu->rx_ue_information.handle = handle;
pdu->rx_ue_information.rnti = rnti; pdu->rx_ue_information.rnti = rnti;
//LOG_I(MAC, "Panos-D: fill_uci_harq_indication_UE_MAC 3 \n");
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG; pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
...@@ -329,7 +325,6 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id, ...@@ -329,7 +325,6 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id,
} }
else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) && else if ((harq_information->harq_information_rel9_fdd.ack_nack_mode == 0) &&
(harq_information->harq_information_rel9_fdd.harq_size == 2)) { (harq_information->harq_information_rel9_fdd.harq_size == 2)) {
//LOG_I(MAC, "Panos-D: fill_uci_harq_indication_UE_MAC 6 \n");
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG; pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
pdu->harq_indication_fdd_rel13.mode = 0; pdu->harq_indication_fdd_rel13.mode = 0;
pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2; pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2;
...@@ -384,7 +379,6 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, ...@@ -384,7 +379,6 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
} }
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) { else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) {
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3 \n");
//AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0, //AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti); // "No available UE ULSCH for rnti %x\n",ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti);
...@@ -411,7 +405,6 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, ...@@ -411,7 +405,6 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
} }
} }
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3.2 \n");
if(ulsch_harq_information!=NULL) if(ulsch_harq_information!=NULL)
fill_ulsch_harq_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti); fill_ulsch_harq_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti);
...@@ -497,7 +490,6 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, ...@@ -497,7 +490,6 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
} }
else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) {
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 9 \n");
//AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0, //AssertFatal((UE_id = find_uci(rel8->rnti,proc->frame_tx,proc->subframe_tx,eNB,SEARCH_EXIST_OR_FREE))>=0,
// "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti); // "No available UE UCI for rnti %x\n",ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti);
...@@ -541,9 +533,6 @@ int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int timer_frame, int ti ...@@ -541,9 +533,6 @@ int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req, int timer_frame, int ti
for (int i=0;i<req->ul_config_request_body.number_of_pdus;i++) for (int i=0;i<req->ul_config_request_body.number_of_pdus;i++)
{ {
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, ul_config_pdu_list[i].pdu_size);
//LOG_D(MAC, "Panos-D: ul_config_req_UE_MAC 2.0 #PDUs: %d \n", i<req->ul_config_request_body.number_of_pdus);
if ( if (
(req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_mac_inst[Mod_id].crnti) || (req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE && req->ul_config_request_body.ul_config_pdu_list[i].ulsch_pdu.ulsch_pdu_rel8.rnti == UE_mac_inst[Mod_id].crnti) ||
...@@ -603,18 +592,13 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //, ...@@ -603,18 +592,13 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //,
//if (req!=NULL && tx_request_pdu_list!=NULL){ //if (req!=NULL && tx_request_pdu_list!=NULL){
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);
//Mod_id = 0; //Panos: Currently static (only for one UE) but this should change. //Mod_id = 0; // Currently static (only for one UE) but this should change.
/*struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; /*struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];*/ eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];*/
nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list; nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list;
nfapi_dl_config_request_pdu_t *dl_config_pdu_tmp; nfapi_dl_config_request_pdu_t *dl_config_pdu_tmp;
/*LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[sf&1];
pdcch_vars->num_pdcch_symbols = req->dl_config_request_body.number_pdcch_ofdm_symbols;
pdcch_vars->num_dci = 0;*/
//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);
...@@ -720,7 +704,7 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //, ...@@ -720,7 +704,7 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //,
i++; i++;
} }
else { else {
LOG_E(MAC,"[UE %d] %d Frame %d, subframe %d : Cannot extract DLSCH PDU from NFAPI 2\n",Mod_id, sfn, sf); LOG_E(MAC,"[UE %d] Frame %d, subframe %d : Cannot extract DLSCH PDU from NFAPI 2\n",Mod_id, sfn, sf);
i++; i++;
} }
...@@ -747,34 +731,8 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //, ...@@ -747,34 +731,8 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req, module_id_t Mod_id) //,
//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)
free(req->vendor_extension);
if(req->dl_config_request_body.dl_config_pdu_list!=NULL){
free(req->dl_config_request_body.dl_config_pdu_list);
req->dl_config_request_body.dl_config_pdu_list = NULL;
}
free(req);
req = NULL;*/
return 0; return 0;
/*}
else if(req!=NULL){
//LOG_I(MAC, "Panos-D: dl_config_req_UE_MAC probably dummy DL_Config \n");
if(req->dl_config_request_body.dl_config_pdu_list!=NULL){
//LOG_I(MAC, "Panos-D: dl_config_req_UE_MAC probably dummy DL_Config 2\n");
free(req->dl_config_request_body.dl_config_pdu_list);
req->dl_config_request_body.dl_config_pdu_list = NULL;
}
free(req);
req = NULL;
return -1;
}*/
} }
...@@ -829,12 +787,10 @@ int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req, module_id_t Mod_id) ...@@ -829,12 +787,10 @@ int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req, module_id_t Mod_id)
// 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)
{ {
//LOG_I(MAC, "Panos-D: memcpy_dl_config_req 1");
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.
for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){ //for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
dl_config_req = (nfapi_dl_config_request_t*)malloc(sizeof(nfapi_dl_config_request_t)); 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, Mod_id:%d \n", Mod_id); //LOG_I(MAC, "Panos-D: memcpy_dl_config_req 1, Mod_id:%d \n", Mod_id);
...@@ -858,7 +814,7 @@ int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request ...@@ -858,7 +814,7 @@ int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request
dl_config_req->dl_config_request_body.dl_config_pdu_list[i] = req->dl_config_request_body.dl_config_pdu_list[i]; dl_config_req->dl_config_request_body.dl_config_pdu_list[i] = req->dl_config_request_body.dl_config_pdu_list[i];
} }
} //}
return 0; return 0;
...@@ -868,10 +824,10 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request ...@@ -868,10 +824,10 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
{ {
//LOG_D(MAC, "Panos-D: memcpy_ul_config_req 1 \n"); //LOG_D(MAC, "Panos-D: memcpy_ul_config_req 1 \n");
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.
for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){ //for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
ul_config_req = (nfapi_ul_config_request_t*)malloc(sizeof(nfapi_ul_config_request_t)); ul_config_req = (nfapi_ul_config_request_t*)malloc(sizeof(nfapi_ul_config_request_t));
...@@ -891,7 +847,7 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request ...@@ -891,7 +847,7 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
for(int i=0; i<ul_config_req->ul_config_request_body.number_of_pdus; i++) { for(int i=0; i<ul_config_req->ul_config_request_body.number_of_pdus; i++) {
ul_config_req->ul_config_request_body.ul_config_pdu_list[i] = req->ul_config_request_body.ul_config_pdu_list[i]; ul_config_req->ul_config_request_body.ul_config_pdu_list[i] = req->ul_config_request_body.ul_config_pdu_list[i];
} }
} //}
return 0; return 0;
} }
...@@ -901,7 +857,7 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request ...@@ -901,7 +857,7 @@ 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)
{ {
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.
tx_req_num_elems = req->tx_request_body.number_of_pdus; tx_req_num_elems = req->tx_request_body.number_of_pdus;
...@@ -928,9 +884,9 @@ int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* ...@@ -928,9 +884,9 @@ int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t*
{ {
//if(req!=0){ //if(req!=0){
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.
for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){ //for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
hi_dci0_req = (nfapi_hi_dci0_request_t*)malloc(sizeof(nfapi_hi_dci0_request_t)); hi_dci0_req = (nfapi_hi_dci0_request_t*)malloc(sizeof(nfapi_hi_dci0_request_t));
hi_dci0_req->sfn_sf = req->sfn_sf; hi_dci0_req->sfn_sf = req->sfn_sf;
...@@ -953,7 +909,7 @@ int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* ...@@ -953,7 +909,7 @@ int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t*
//LOG_I(MAC, "Original hi_dci0 req. type:%d, Copy type: %d \n",req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type, UE_mac_inst[Mod_id].hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type); //LOG_I(MAC, "Original hi_dci0 req. type:%d, Copy type: %d \n",req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type, UE_mac_inst[Mod_id].hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list[i].pdu_type);
} }
} //}
return 0; return 0;
} }
...@@ -1057,7 +1013,7 @@ uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn) { return(0);} ...@@ -1057,7 +1013,7 @@ uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn) { return(0);}
int32_t get_uldl_offset(int eutra_bandP) { return(0);} int32_t get_uldl_offset(int eutra_bandP) { return(0);}
int l1_north_init_eNB() { int l1_north_init_eNB() {
return 0;
} }
void init_eNB_afterRU(void) { void init_eNB_afterRU(void) {
......
This diff is collapsed.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#define RRC_UE #define RRC_UE
#define RRC_UE_C #define RRC_UE_C
#define _GNU_SOURCE
#include "assertions.h" #include "assertions.h"
#include "hashtable.h" #include "hashtable.h"
...@@ -3869,12 +3870,12 @@ uint64_t arfcn_to_freq(long arfcn) { ...@@ -3869,12 +3870,12 @@ uint64_t arfcn_to_freq(long arfcn) {
LOG_I( RRC, "[UE] Dumping SIB18\n" ); LOG_I( RRC, "[UE] Dumping SIB18\n" );
for (int i = 0; i < sib18->commConfig_r12->commRxPool_r12.list.count; i++) { for (int i = 0; i < sib18->commConfig_r12->commRxPool_r12.list.count; i++) {
LOG_I(RRC, " Contents of SIB18 %d/%d \n", i+1, sib18->commConfig_r12->commRxPool_r12.list.count); LOG_I(RRC, " Contents of SIB18 %d/%d \n", i+1, sib18->commConfig_r12->commRxPool_r12.list.count);
LOG_I(RRC, " SIB18 rxPool_sc_CP_Len: %d \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_CP_Len_r12); LOG_I(RRC, " SIB18 rxPool_sc_CP_Len: %ld \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_CP_Len_r12);
LOG_I(RRC, " SIB18 sc_Period_r12: %d \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_Period_r12); LOG_I(RRC, " SIB18 sc_Period_r12: %ld \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_Period_r12);
LOG_I(RRC, " SIB18 data_CP_Len_r12: %d \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->data_CP_Len_r12); LOG_I(RRC, " SIB18 data_CP_Len_r12: %ld \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->data_CP_Len_r12);
LOG_I(RRC, " SIB18 prb_Num_r12: %d \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_TF_ResourceConfig_r12.prb_Num_r12); LOG_I(RRC, " SIB18 prb_Num_r12: %ld \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_TF_ResourceConfig_r12.prb_Num_r12);
LOG_I(RRC, " SIB18 prb_Start_r12: %d \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_TF_ResourceConfig_r12.prb_Start_r12); LOG_I(RRC, " SIB18 prb_Start_r12: %ld \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_TF_ResourceConfig_r12.prb_Start_r12);
LOG_I(RRC, " SIB18 prb_End_r12: %d \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_TF_ResourceConfig_r12.prb_End_r12); LOG_I(RRC, " SIB18 prb_End_r12: %ld \n", sib18->commConfig_r12->commRxPool_r12.list.array[i]->sc_TF_ResourceConfig_r12.prb_End_r12);
//to add more log //to add more log
} }
} }
...@@ -3885,13 +3886,13 @@ uint64_t arfcn_to_freq(long arfcn) { ...@@ -3885,13 +3886,13 @@ uint64_t arfcn_to_freq(long arfcn) {
LOG_I( RRC, "[UE] Dumping SIB19\n" ); LOG_I( RRC, "[UE] Dumping SIB19\n" );
for (int i = 0; i < sib19->discConfig_r12->discRxPool_r12.list.count; i++) { for (int i = 0; i < sib19->discConfig_r12->discRxPool_r12.list.count; i++) {
LOG_I(RRC, " Contents of SIB19 %d/%d \n", i+1, sib19->discConfig_r12->discRxPool_r12.list.count); LOG_I(RRC, " Contents of SIB19 %d/%d \n", i+1, sib19->discConfig_r12->discRxPool_r12.list.count);
LOG_I(RRC, " SIB19 cp_Len_r12: %d \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->cp_Len_r12); LOG_I(RRC, " SIB19 cp_Len_r12: %ld \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->cp_Len_r12);
LOG_I(RRC, " SIB19 discPeriod_r12: %d \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->discPeriod_r12); LOG_I(RRC, " SIB19 discPeriod_r12: %ld \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->discPeriod_r12);
LOG_I(RRC, " SIB19 numRetx_r12: %d \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->numRetx_r12); LOG_I(RRC, " SIB19 numRetx_r12: %ld \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->numRetx_r12);
LOG_I(RRC, " SIB19 numRepetition_r12: %d \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->numRepetition_r12); LOG_I(RRC, " SIB19 numRepetition_r12: %ld \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->numRepetition_r12);
LOG_I(RRC, " SIB19 prb_Num_r12: %d \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->tf_ResourceConfig_r12.prb_Num_r12); LOG_I(RRC, " SIB19 prb_Num_r12: %ld \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->tf_ResourceConfig_r12.prb_Num_r12);
LOG_I(RRC, " SIB19 prb_Start_r12: %d \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->tf_ResourceConfig_r12.prb_Start_r12); LOG_I(RRC, " SIB19 prb_Start_r12: %ld \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->tf_ResourceConfig_r12.prb_Start_r12);
LOG_I(RRC, " SIB19 prb_End_r12: %d \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->tf_ResourceConfig_r12.prb_End_r12); LOG_I(RRC, " SIB19 prb_End_r12: %ld \n", sib19->discConfig_r12->discRxPool_r12.list.array[i]->tf_ResourceConfig_r12.prb_End_r12);
//to add more log //to add more log
} }
} }
...@@ -3902,9 +3903,9 @@ uint64_t arfcn_to_freq(long arfcn) { ...@@ -3902,9 +3903,9 @@ uint64_t arfcn_to_freq(long arfcn) {
LOG_I(RRC, " Contents of SIB21 %d/%d \n", i+1, sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.count); LOG_I(RRC, " Contents of SIB21 %d/%d \n", i+1, sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.count);
LOG_I(RRC, " SIB21 sl_Subframe_r14: %d \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->sl_Subframe_r14.present); LOG_I(RRC, " SIB21 sl_Subframe_r14: %d \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->sl_Subframe_r14.present);
LOG_I(RRC, " SIB21 adjacencyPSCCH_PSSCH_r14: %d \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->adjacencyPSCCH_PSSCH_r14); LOG_I(RRC, " SIB21 adjacencyPSCCH_PSSCH_r14: %d \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->adjacencyPSCCH_PSSCH_r14);
LOG_I(RRC, " SIB21 sizeSubchannel_r14: %d \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->sizeSubchannel_r14); LOG_I(RRC, " SIB21 sizeSubchannel_r14: %ld \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->sizeSubchannel_r14);
LOG_I(RRC, " SIB21 numSubchannel_r14: %d \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->numSubchannel_r14); LOG_I(RRC, " SIB21 numSubchannel_r14: %ld \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->numSubchannel_r14);
LOG_I(RRC, " SIB21 startRB_Subchannel_r14: %d \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->startRB_Subchannel_r14); LOG_I(RRC, " SIB21 startRB_Subchannel_r14: %ld \n", sib21->sl_V2X_ConfigCommon_r14->v2x_CommRxPool_r14->list.array[i]->startRB_Subchannel_r14);
//to add more log //to add more log
} }
} }
...@@ -5297,7 +5298,7 @@ rrc_top_cleanup_ue( ...@@ -5297,7 +5298,7 @@ rrc_top_cleanup_ue(
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
uint8_t rrc_ue_generate_SidelinkUEInformation( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,SL_DestinationInfoList_r12_t *destinationInfoList, long *discTxResourceReq, SL_TRIGGER_t mode) uint8_t rrc_ue_generate_SidelinkUEInformation( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,SL_DestinationInfoList_r12_t *destinationInfoList, long *discTxResourceReq, SL_TRIGGER_t mode)
{ {
uint8_t size; uint8_t size=0;
uint8_t buffer[100]; uint8_t buffer[100];
//Generate SidelinkUEInformation //Generate SidelinkUEInformation
...@@ -5346,7 +5347,7 @@ uint8_t fill_SLSS(const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, ...@@ -5346,7 +5347,7 @@ uint8_t fill_SLSS(const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,
//if RRC_CONNECTED (Todo: and if networkControlledSyncTx (RRCConnectionReconfiguration) is configured and set to On) //if RRC_CONNECTED (Todo: and if networkControlledSyncTx (RRCConnectionReconfiguration) is configured and set to On)
if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State == RRC_CONNECTED){ if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State == RRC_CONNECTED){
//select subframe(s) indicated by syncOffsetIndicator //select subframe(s) indicated by syncOffsetIndicator
subframe = syncOffsetIndicator; *subframe = syncOffsetIndicator;
} else { } else {
//select subframe(s) indicated by syncOffsetIndicator within SC period //select subframe(s) indicated by syncOffsetIndicator within SC period
} }
...@@ -5429,9 +5430,9 @@ rrc_ue_process_sidelink_radioResourceConfig( ...@@ -5429,9 +5430,9 @@ rrc_ue_process_sidelink_radioResourceConfig(
Mod_idP, sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.sl_RNTI_r12.size ); Mod_idP, sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.sl_RNTI_r12.size );
LOG_I(RRC,"[UE %d][RRC_UE] scheduled resource for SL, sl_RNTI buf 0x%08x \n", LOG_I(RRC,"[UE %d][RRC_UE] scheduled resource for SL, sl_RNTI buf 0x%08x \n",
Mod_idP, sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.sl_RNTI_r12.buf ); Mod_idP, sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.sl_RNTI_r12.buf );
LOG_I(RRC,"[UE %d][RRC_UE] scheduled resource for SL, Mac_MainConfig_r12.retx_BSR_TimerSL %d \n", LOG_I(RRC,"[UE %d][RRC_UE] scheduled resource for SL, Mac_MainConfig_r12.retx_BSR_TimerSL %ld \n",
Mod_idP, sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12.retx_BSR_TimerSL ); Mod_idP, sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12.retx_BSR_TimerSL );
LOG_I(RRC,"[UE %d][RRC_UE] scheduled resource for SL, sc_CommTxConfig %d \n", LOG_I(RRC,"[UE %d][RRC_UE] scheduled resource for SL, sc_CommTxConfig %ld \n",
Mod_idP, sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12.retx_BSR_TimerSL ); Mod_idP, sl_CommConfig->commTxResources_r12->choice.setup.choice.scheduled_r12.mac_MainConfig_r12.retx_BSR_TimerSL );
//configure scheduled resource for SL //configure scheduled resource for SL
//TODO //TODO
...@@ -5522,7 +5523,7 @@ rrc_control_socket_init(){ ...@@ -5522,7 +5523,7 @@ rrc_control_socket_init(){
pthread_attr_t attr; pthread_attr_t attr;
struct sched_param sched_param; struct sched_param sched_param;
int optval; // flag value for setsockopt int optval; // flag value for setsockopt
int n; // message byte size //int n; // message byte size
// create the control socket // create the control socket
...@@ -5579,7 +5580,7 @@ void *rrc_control_socket_thread_fct(void *arg) ...@@ -5579,7 +5580,7 @@ void *rrc_control_socket_thread_fct(void *arg)
int prose_addr_len; int prose_addr_len;
char send_buf[BUFSIZE]; char send_buf[BUFSIZE];
char receive_buf[BUFSIZE]; char receive_buf[BUFSIZE];
int optval; //int optval;
int n; int n;
struct sidelink_ctrl_element *sl_ctrl_msg_recv = NULL; struct sidelink_ctrl_element *sl_ctrl_msg_recv = NULL;
struct sidelink_ctrl_element *sl_ctrl_msg_send = NULL; struct sidelink_ctrl_element *sl_ctrl_msg_send = NULL;
...@@ -5599,13 +5600,13 @@ void *rrc_control_socket_thread_fct(void *arg) ...@@ -5599,13 +5600,13 @@ void *rrc_control_socket_thread_fct(void *arg)
//from the main program, listen for the incoming messages from control socket (ProSe App) //from the main program, listen for the incoming messages from control socket (ProSe App)
prose_addr_len = sizeof(prose_app_addr); prose_addr_len = sizeof(prose_app_addr);
int enable_notification = 1; //int enable_notification = 1;
while (1) { while (1) {
LOG_I(RRC,"Listening to incoming connection from ProSe App \n"); LOG_I(RRC,"Listening to incoming connection from ProSe App \n");
// receive a message from ProSe App // receive a message from ProSe App
memset(receive_buf, 0, BUFSIZE); memset(receive_buf, 0, BUFSIZE);
n = recvfrom(ctrl_sock_fd, receive_buf, BUFSIZE, 0, n = recvfrom(ctrl_sock_fd, receive_buf, BUFSIZE, 0,
(struct sockaddr *) &prose_app_addr, &prose_addr_len); (struct sockaddr *) &prose_app_addr, (socklen_t *)&prose_addr_len);
if (n < 0){ if (n < 0){
LOG_E(RRC, "ERROR: Failed to receive from ProSe App\n"); LOG_E(RRC, "ERROR: Failed to receive from ProSe App\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
......
This diff is collapsed.
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \ {"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
{"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \ {"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \
{"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \ {"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \
{"num-ues", NULL, 0, iptr:&(NB_UE_INST), defintval:1, TYPE_INT, 0}, \ {"num-ues", NULL, 0, u8ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT8, 0}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0} \ {"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0} \
} }
......
...@@ -81,7 +81,17 @@ void *UE_thread(void *arg); ...@@ -81,7 +81,17 @@ void *UE_thread(void *arg);
void init_UE(int nb_inst,int,int,int); void init_UE(int nb_inst,int,int,int);
void init_UE_stub(int nb_inst,int,int,char*); void init_UE_stub(int nb_inst,int,int,char*);
void init_UE_stub_single_thread(int nb_inst,int,int,char*); void init_UE_stub_single_thread(int nb_inst,int,int,char*);
int init_timer_thread(void);
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf); extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
extern void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
unsigned char _multicast_group, char *multicast_ifname);
extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
extern int oai_nfapi_crc_indication(nfapi_crc_indication_t *crc_ind);
extern int oai_nfapi_harq_indication(nfapi_harq_indication_t *harq_ind);
extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
//extern int tx_req_UE_MAC1(); //extern int tx_req_UE_MAC1();
void ue_stub_rx_handler(unsigned int, char *); void ue_stub_rx_handler(unsigned int, char *);
...@@ -891,10 +901,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) { ...@@ -891,10 +901,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
char threadname[256]; char threadname[256];
//sprintf(threadname,"UE_%d_proc", UE->Mod_id); //sprintf(threadname,"UE_%d_proc", UE->Mod_id);
// Panos: Call (Sched_Rsp_t) get_nfapi_sched_response(UE->Mod_ID) to get all
//sched_response config messages which concern the specific UE. Inside this
//function we should somehow make the translation of rnti to Mod_ID.
//proc->instance_cnt_rxtx=-1; //proc->instance_cnt_rxtx=-1;
phy_stub_ticking->ticking_var = -1; phy_stub_ticking->ticking_var = -1;
...@@ -946,26 +952,22 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) { ...@@ -946,26 +952,22 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = (nfapi_rx_indication_pdu_t*)malloc(NB_UE_INST*sizeof(nfapi_rx_indication_pdu_t)); UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = (nfapi_rx_indication_pdu_t*)malloc(NB_UE_INST*sizeof(nfapi_rx_indication_pdu_t));
UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0; UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0;
//UL_INFO->rx_ind.header.message_id = 3225;
UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = (nfapi_crc_indication_pdu_t*)malloc(NB_UE_INST*sizeof(nfapi_crc_indication_pdu_t)); UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = (nfapi_crc_indication_pdu_t*)malloc(NB_UE_INST*sizeof(nfapi_crc_indication_pdu_t));
UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0; UL_INFO->crc_ind.crc_indication_body.number_of_crcs = 0;
//UL_INFO->crc_ind.header.message_id = 3225;
UL_INFO->harq_ind.harq_indication_body.harq_pdu_list = (nfapi_harq_indication_pdu_t*)malloc(NB_UE_INST*sizeof(nfapi_harq_indication_pdu_t)); UL_INFO->harq_ind.harq_indication_body.harq_pdu_list = (nfapi_harq_indication_pdu_t*)malloc(NB_UE_INST*sizeof(nfapi_harq_indication_pdu_t));
UL_INFO->harq_ind.harq_indication_body.number_of_harqs = 0; UL_INFO->harq_ind.harq_indication_body.number_of_harqs = 0;
//UL_INFO->harq_ind.header.message_id = 3225;
UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = (nfapi_sr_indication_pdu_t*)malloc(NB_UE_INST*sizeof(nfapi_sr_indication_pdu_t)); UL_INFO->sr_ind.sr_indication_body.sr_pdu_list = (nfapi_sr_indication_pdu_t*)malloc(NB_UE_INST*sizeof(nfapi_sr_indication_pdu_t));
UL_INFO->sr_ind.sr_indication_body.number_of_srs = 0; UL_INFO->sr_ind.sr_indication_body.number_of_srs = 0;
//UL_INFO->sr_ind.header.message_id = 3225;
for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++) { for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++) {
//LOG_I(MAC, "Panos-D: UE_phy_stub_single_thread_rxn_txnp4, NB_UE_INST:%d, Mod_id:%d \n", NB_UE_INST, Mod_id); //LOG_D(MAC, "UE_phy_stub_single_thread_rxn_txnp4, NB_UE_INST:%d, Mod_id:%d \n", NB_UE_INST, Mod_id);
UE = PHY_vars_UE_g[Mod_id][0]; UE = PHY_vars_UE_g[Mod_id][0];
lte_subframe_t sf_type = subframe_select( &UE->frame_parms, proc->subframe_rx); lte_subframe_t sf_type = subframe_select( &UE->frame_parms, proc->subframe_rx);
if ((sf_type == SF_DL) || if ((sf_type == SF_DL) ||
...@@ -1210,9 +1212,6 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) { ...@@ -1210,9 +1212,6 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
char threadname[256]; char threadname[256];
sprintf(threadname,"UE_%d_proc", UE->Mod_id); sprintf(threadname,"UE_%d_proc", UE->Mod_id);
// Panos: Call (Sched_Rsp_t) get_nfapi_sched_response(UE->Mod_ID) to get all
//sched_response config messages which concern the specific UE. Inside this
//function we should somehow make the translation of rnti to Mod_ID.
//proc->instance_cnt_rxtx=-1; //proc->instance_cnt_rxtx=-1;
...@@ -2049,7 +2048,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg) ...@@ -2049,7 +2048,7 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg)
// Panos: This timer thread is used only in the phy_sub mode as an independent timer // Panos: This timer thread is used only in the phy_stub mode as an independent timer
// which will be ticking and provide the SFN/SF values that will be used from the UE threads // which will be ticking and provide the SFN/SF values that will be used from the UE threads
// playing the role of nfapi-pnf. // playing the role of nfapi-pnf.
...@@ -2062,7 +2061,7 @@ static void* timer_thread( void* param ) { ...@@ -2062,7 +2061,7 @@ static void* timer_thread( void* param ) {
phy_stub_ticking->ticking_var = -1; phy_stub_ticking->ticking_var = -1;
PHY_VARS_UE *UE; PHY_VARS_UE *UE;
UE = PHY_vars_UE_g[0][0]; UE = PHY_vars_UE_g[0][0];
double t_diff; //double t_diff;
int external_timer = 0; int external_timer = 0;
...@@ -2097,7 +2096,7 @@ static void* timer_thread( void* param ) { ...@@ -2097,7 +2096,7 @@ static void* timer_thread( void* param ) {
clock_gettime(CLOCK_MONOTONIC, &t_start); clock_gettime(CLOCK_MONOTONIC, &t_start);
T_0 = (uint64_t) t_start.tv_sec*1000000000 + t_start.tv_nsec; T_0 = (uint64_t) t_start.tv_sec*1000000000 + t_start.tv_nsec;
LOG_D(MAC, "Panos-D: timer_thread(), T_0 value: %" PRId64 "\n", T_0); LOG_D(MAC, "timer_thread(), T_0 value: %" PRId64 "\n", T_0);
while (!oai_exit) { while (!oai_exit) {
...@@ -2163,11 +2162,11 @@ static void* timer_thread( void* param ) { ...@@ -2163,11 +2162,11 @@ static void* timer_thread( void* param ) {
} }
stop_meas(&UE->timer_stats); /*stop_meas(&UE->timer_stats);
t_diff = get_time_meas_us(&UE->timer_stats); t_diff = get_time_meas_us(&UE->timer_stats);
stop_meas(&UE->timer_stats); stop_meas(&UE->timer_stats);
t_diff = get_time_meas_us(&UE->timer_stats); t_diff = get_time_meas_us(&UE->timer_stats);*/
} }
free(phy_stub_ticking); free(phy_stub_ticking);
pthread_cond_destroy(&phy_stub_ticking->cond_ticking); pthread_cond_destroy(&phy_stub_ticking->cond_ticking);
...@@ -2324,7 +2323,6 @@ static void* timer_thread( void* param ) { ...@@ -2324,7 +2323,6 @@ static void* timer_thread( void* param ) {
int init_timer_thread(void) { int init_timer_thread(void) {
// Panos: CAREFUL Originally this was set to PHY_VARS_UE *UE=PHY_vars_UE_g[0]
//PHY_VARS_UE *UE=PHY_vars_UE_g[0]; //PHY_VARS_UE *UE=PHY_vars_UE_g[0];
PHY_VARS_UE *UE=PHY_vars_UE_g[0][0]; PHY_VARS_UE *UE=PHY_vars_UE_g[0][0];
phy_stub_ticking = (SF_ticking*)malloc(sizeof(SF_ticking)); phy_stub_ticking = (SF_ticking*)malloc(sizeof(SF_ticking));
......
...@@ -216,6 +216,7 @@ uint64_t num_missed_slots=0; // counter for the number of missed slots ...@@ -216,6 +216,7 @@ uint64_t num_missed_slots=0; // counter for the number of missed slots
extern void reset_opp_meas(void); extern void reset_opp_meas(void);
extern void print_opp_meas(void); extern void print_opp_meas(void);
extern void init_UE_stub_single_thread(int nb_inst,int eMBMS_active, int uecap_xer_in, char *emul_iface);
extern PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms, extern PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t UE_id, uint8_t UE_id,
...@@ -1167,6 +1168,7 @@ int main( int argc, char **argv ) ...@@ -1167,6 +1168,7 @@ int main( int argc, char **argv )
nfapi_mode_str = "<UNKNOWN NFAPI MODE>"; nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
break; break;
} }
printf("NFAPI MODE:%s\n", nfapi_mode_str);
// start the main threads // start the main threads
......
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