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
${OPENAIR_TARGETS}/COMMON/create_tasks.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
......@@ -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 ${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
......@@ -2471,7 +2383,7 @@ endforeach(myExe)
if (${T_TRACER})
foreach(i
#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
pdcchsim pucchsim prachsim syncsim
......
......@@ -499,14 +499,6 @@ function main() {
DIR=$OPENAIR_DIR/cmake_targets
if [ "$NOS1" = "1" ] ; then
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
lte_exec=lte-softmodem-nos1
fi
......@@ -521,7 +513,6 @@ function main() {
if [ "$UE" = "1" ] ; then
lte_exec=lte-uesoftmodem
fi
#>>>>>>> main/develop
fi
# 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
nfapi_crc_indication_body_t* value = (nfapi_crc_indication_body_t*)tlv;
if(push16(value->number_of_crcs, ppWritePackedMsg, end) == 0){
printf("Panos-D: pack_crc_indication_body_value 0 \n");
return 0;
}
......@@ -1844,13 +1843,11 @@ static uint8_t pack_crc_indication_body_value(void* tlv, uint8_t **ppWritePacked
uint8_t* instance_length_p = *ppWritePackedMsg;
if(!push16(pdu->instance_length, ppWritePackedMsg, end)){
printf("Panos-D: pack_crc_indication_body_value 1 \n");
return 0;
}
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))){
printf("Panos-D: pack_crc_indication_body_value 2 \n");
return 0;
}
......@@ -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){
printf("Panos-D: pack_rx_ulsch_indication_body_value() 2 about to return error \n");
return 0;
}
}
......@@ -2788,7 +2784,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
pMessageHeader->message_length = packedMsgLen16;
if(!push16(packedMsgLen16, &pPackedLengthField, end)){
printf("Panos-D: Pack function failed. Returning... \n");
//printf("Panos-D: Pack function failed. Returning... \n");
return -1;
}
......@@ -2797,7 +2793,7 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
//quick test
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);
}
}
......
......@@ -416,14 +416,14 @@ int pnf_p7_send_message(pnf_p7_t* pnf_p7, uint8_t* msg, uint32_t len)
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)
{
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);
return -1;
}
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);
}
return 0;
......@@ -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
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");
return -1;
}
......@@ -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)
{
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");
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 );
return -1;
}
......@@ -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 offset = NFAPI_P7_HEADER_LENGTH;
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)
{
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)
}
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_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
// unpack the message
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__);
return;
}
......
......@@ -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)
{
printf("Panos-D: %s: invalid input params\n", __FUNCTION__);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
......@@ -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)
{
printf("Panos-D: %s: invalid input params\n", __FUNCTION__);
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: invalid input params\n", __FUNCTION__);
return -1;
}
......
......@@ -370,8 +370,6 @@ void phy_cleanup(void);
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);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
......
......@@ -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_allavg[D_NPUCCH_SF5];
//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];
int16_t n_oc0[NUMBER_OF_UE_MAX];
int16_t n_oc1[NUMBER_OF_UE_MAX];
......
......@@ -33,6 +33,7 @@
#define __LTE_TRANSPORT_SLSS__C__
#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) {
......
......@@ -33,6 +33,9 @@
#define __LTE_TRANSPORT_SLSS__C__
#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) {
......
......@@ -58,7 +58,7 @@
#include "msc.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 "assertions.h"
......@@ -1434,12 +1434,6 @@ typedef struct {
/// N0 (used for abstraction)
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_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)
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
LTE_eNB_ULSCH_t *ulsch;
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 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
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)
......
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
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;
// 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,
......@@ -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,
SL_DISCOVERY,
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);
......@@ -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) {
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;
UE_MAC_INST *ue = &UE_mac_inst[module_idP];
int rvtab[4] = {0,2,3,1};
......
......@@ -469,7 +469,7 @@ int pdcp_pc5_sockfd;
struct sockaddr_in prose_ctrl_addr;
struct sockaddr_in prose_pdcp_addr;
struct sockaddr_in pdcp_sin;
int pdcp_pc5_socket_init();
void pdcp_pc5_socket_init(void);
typedef struct {
rb_id_t rb_id;
......
......@@ -487,13 +487,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
#ifdef Rel14
int prose_addr_len;
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;
sidelink_pc5s_element *sl_pc5s_msg_recv = NULL;
sidelink_pc5s_element *sl_pc5s_msg_send = NULL;
uint32_t sourceL2Id;
uint32_t groupL2Id;
module_id_t module_id = 0;
//uint32_t sourceL2Id;
//uint32_t groupL2Id;
//module_id_t module_id = 0;
pc5s_header_t *pc5s_header;
#endif
......@@ -633,7 +634,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
// receive a message from ProSe App
memset(receive_buf, 0, BUFSIZE);
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){
// LOG_E(RRC, "ERROR: Failed to receive from ProSe App\n");
// exit(EXIT_FAILURE);
......@@ -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);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
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 {
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",
......@@ -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);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
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) {
......@@ -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);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
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 {
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",
......@@ -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);
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
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) {
......@@ -1186,12 +1187,12 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
//TTN for D2D (PC5S)
#ifdef Rel14
int
void
pdcp_pc5_socket_init() {
pthread_attr_t attr;
struct sched_param sched_param;
//pthread_attr_t attr;
//struct sched_param sched_param;
int optval; // flag value for setsockopt
int n; // message byte size
//int n; // message byte size
//create PDCP socket
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,
extern void *pdcp_tx (void *argP);
#endif
void pdcp_pc5_socket_init();
extern void pdcp_pc5_socket_init(void);
#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;