Commit a3380204 authored by Raymond Knopp's avatar Raymond Knopp

addition of Sidelink UE-UE stub and initial MAC scheduling for Sidelink for off-network scenario

parent d34ac165
......@@ -1096,6 +1096,9 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slss.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/sldch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/slsch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
......@@ -1946,7 +1949,7 @@ add_executable(lte-softmodem-stub
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
#${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
......
......@@ -864,11 +864,80 @@ typedef enum {
} RX_type_t;
#ifdef Rel14
typedef enum {
DCI_COMMON_SPACE,
DCI_UE_SPACE
} dci_space_t;
typedef struct {
uint16_t slss_id;
uint8_t *slmib;
} SLSS_t;
typedef struct {
// SL Configuration
/// Number of SL resource blocks (1-100)
uint32_t N_SL_RB;
/// prb-start (0-99)
uint32_t prb_Start;
/// prb-End (0-99)
uint32_t prb_End;
/// SL-OffsetIndicator (0-10239)
uint32_t SL_OffsetIndicator;
/// PSCCH subframe bitmap, first 64-bits (up to 40 bits for Rel 12)
uint64_t bitmap1;
/// PSCCH subframe bitmap, 2nd 64-bits (up to 100 bits for Rel 14)
uint64_t bitmap2;
// SCI parameters
/// npscch resource index
uint32_t n_pscch;
/// format of SCI (0,1)
uint32_t format;
/// SCI0 frequency hopping flag
uint32_t freq_hopping_flag;
/// SCI0 Resource Block Coding
uint32_t resource_block_coding;
/// SCI0 Time Resource Pattern for SLSCH
uint32_t time_resource_pattern;
/// SCI0 MCS for SLSCH
uint32_t mcs;
/// SCI0 Timing advance indication for SLSCH
uint32_t timing_advance_indication;
/// SCI0 Group Destination ID for SLSCH
uint32_t group_destination_id;
// SLSCH Parameters
/// Number of Subbands (36.213 14.1.1.2)
uint32_t Nsb;
/// N_RB_HO (36.213 14.1.1.2)
uint32_t N_RB_HO;
/// n_ss_PSSCH (36.211 9.2.4)
uint32_t n_ss_PSSCH;
/// n_ssf_PSSCH
uint32_t n_ssf_PSSCH;
/// cinit (36.331 hoppingParameter-r12)
uint32_t cinit;
/// redundancy version
uint32_t rvidx;
/// n_prime_VRB (36.213 14.1.1.2.1)
uint32_t n_prime_VRB;
/// M_RB_PSSCH_RP (36.213 14.1.3
uint32_t M_RB_PSSCH_RP;
/// n_prime_PRB (36.213 14.1.1.4
uint32_t n_prime_PRB;
/// m_nprime_PRB_PSSCH (36.213 14.1.3)
uint32_t m_nprime_PRB_PSCCH;
uint8_t *payload;
} SLSCH_t;
typedef struct {
} SLDCH_t;
#endif
/**@}*/
#endif
......@@ -1479,6 +1479,23 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
DCI_ALLOC_t *dci_alloc,
uint8_t subframe);
/*! \brief Top-level generation route for Sidelink BCH,PSS and SSS
\param ue pointer to UE descriptor
\param slss pointer to SLSS configuration and payload
*/
void generate_slss(PHY_VARS_UE *ue,SLSS_t *slss);
/*! \brief Top-level generation route for Sidelink Discovery Channel
\param ue pointer to UE descriptor
\param sldch pointer to SLDCH configuration and payload
*/
void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch);
/*! \brief Top-level generation route for Sidelink Shared Channel
\param ue pointer to UE descriptor
\param slsch pointer to SLSCH configuration and payload
*/
void generate_slsch(PHY_VARS_UE *ue,SLSCH_t *slss);
void generate_64qam_table(void);
void generate_16qam_table(void);
......
......@@ -137,6 +137,8 @@ static inline void* malloc16_clear( size_t size )
#include "targets/ARCH/COMMON/common_lib.h"
#include "targets/COMMON/openairinterface5g_limits.h"
#include "openair2/LAYER2/MAC/defs.h"
#if defined(EXMIMO) || defined(OAI_USRP)
//#define NUMBER_OF_eNB_MAX 1
//#define NUMBER_OF_UE_MAX 16
......
......@@ -140,6 +140,19 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t
@param phy_vars_rn pointer to RN variables
*/
int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
/*! \brief Scheduling for UE Sidelink RX procedures in normal subframes.
@param ue Pointer to UE variables on which to act
@param proc Pointer to RXn_TXnp4 proc information
*/
void phy_procedures_UE_SL_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc);
/*! \brief Scheduling for UE Sidelink TX procedures in normal subframes.
@param ue Pointer to UE variables on which to act
@param proc Pointer to RXn_TXnp4 proc information
*/
void phy_procedures_UE_SL_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc);
int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,
relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn);
......
......@@ -2368,6 +2368,27 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
}
void phy_procedures_UE_SL_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
int subframe_tx = proc->subframe_tx;
int frame_tx = proc->frame_tx;
SLSS_t *slss;
SLDCH_t *sldch;
SLSCH_t *slsch;
LOG_D(PHY,"****** start Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx);
// check for SLBCH/SLSS
if ((slss = ue_get_slss(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL) generate_slss(ue,slss);
// check for SLDCH
if ((sldch = ue_get_sldch(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL) generate_sldch(ue,sldch);
// check for SLSCH
if ((slsch = ue_get_slsch(ue->Mod_id,ue->CC_id,frame_tx,subframe_tx)) != NULL) generate_slsch(ue,slsch);
}
void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type) {
......@@ -4757,6 +4778,11 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr
#endif
void phy_procedures_UE_SL_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
}
int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,
relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) {
......
......@@ -69,8 +69,9 @@
#endif
#ifdef Rel14
#include "SystemInformationBlockType1-v1310-IEs.h"
#include "SystemInformationBlockType18-r12.h"
#endif
#include "RadioResourceConfigCommonSIB.h"
#include "nfapi_interface.h"
#include "PHY_INTERFACE/IF_Module.h"
......@@ -978,7 +979,7 @@ typedef struct {
/*! \brief subband bitmap confguration (for ALU icic algo purpose), in test phase */
typedef struct {
uint8_t sbmap[NUMBER_OF_SUBBANDS_MAX]; //13 = number of SB MAX for 100 PRB
uint8_t sbmap[13];
uint8_t periodicity;
uint8_t first_subframe;
uint8_t sb_size;
......@@ -1266,6 +1267,22 @@ typedef struct {
#if defined(Rel10) || defined(Rel14)
/// pointer to RRC PHY configuration SCEll
struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10;
/// Preconfiguration for Sidelink
struct SL_Preconfiguration_r12 *SL_Preconfiguration;
/// RX Pool for Sidelink from SIB18
SL_CommRxPoolList_r12_t commRxPool_r12;
/// TX Pool Normal for Sidelink from SIB18
struct SL_CommTxPoolList_r12 *commTxPoolNormalCommon_r12;
/// TX Pool Exceptional for Sidelink from SIB18
struct SL_CommTxPoolList_r12 *commTxPoolExceptional_r12;
/// Common Sync Config for Sidelink from SIB18
struct SL_SyncConfigList_r12 *commSyncConfig_r12;
/// Dedicated Sync TX control for Sidelink
struct SL_SyncTxControl_r12 *sl_SyncTxControl_r12;
/// Dedicated Discovery TX control for Sidelink
struct SL_DiscConfig_r12 *sl_DiscConfig_r12;
/// Dedicated TX config for Sidelink
struct SL_CommConfig_r12 *sl_CommConfig_r12;
#endif
/// pointer to TDD Configuration (NULL for FDD)
TDD_Config_t *tdd_Config;
......@@ -1298,6 +1315,11 @@ typedef struct {
RAR_PDU RAR_pdu;
/// Incoming DLSCH pdu for PHY
DLSCH_PDU DLSCH_pdu[NUMBER_OF_UE_MAX][2];
#ifdef Rel14
int sltx_active;
SLSCH_t slsch;
ULSCH_PDU slsch_pdu;
#endif
/// number of attempt for rach
uint8_t RA_attempt_number;
/// Random-access procedure flag
......@@ -1409,6 +1431,8 @@ typedef struct {
uint8_t n_adj_cells;
} neigh_cell_id_t;
#include "proto.h"
/*@}*/
#endif /*__LAYER2_MAC_DEFS_H__ */
......
......@@ -476,10 +476,33 @@ int ue_query_mch(uint8_t Mod_id,uint8_t CC_id, uint32_t frame,sub_frame_t subfra
@param eNB_id Index of eNB that UE is attached to
@param rnti C_RNTI of UE
@param subframe subframe number
@returns 0 for no SR, 1 for SR
*/
void ue_get_sdu(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame_t subframe, uint8_t eNB_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
/* \brief Called by PHY to get sdu for PSBCH/SSS/PSS transmission.
@param Mod_id Instance id of UE in machine
@param frame_tx TX frame index
@param subframe_tx TX subframe index
@returns pointer to SLSS_t descriptor
*/
SLSS_t *ue_get_slss(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame_t subframe);
/* \brief Called by PHY to get sdu for PSDCH transmission.
@param Mod_id Instance id of UE in machine
@param frame_tx TX frame index
@param subframe_tx TX subframe index
@returns pointer to SLDCH_t descriptor
*/
SLDCH_t *ue_get_sldch(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame_t subframe);
/* \brief Called by PHY to get sdu for PSSCH transmission.
@param Mod_id Instance id of UE in machine
@param frame_tx TX frame index
@param subframe_tx TX subframe index
@returns pointer to SLSCH_t descriptor
*/
SLSCH_t *ue_get_slsch(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame_t subframe);
/* \brief Function called by PHY to retrieve information to be transmitted using the RA procedure. If the UE is not in PUSCH mode for a particular eNB index, this is assumed to be an Msg3 and MAC attempts to retrieves the CCCH message from RRC. If the UE is in PUSCH mode for a particular eNB index and PUCCH format 0 (Scheduling Request) is not activated, the MAC may use this resource for random-access to transmit a BSR along with the C-RNTI control element (see 5.1.4 from 36.321)
@param Mod_id Index of UE instance
@param Mod_id Component Carrier Index
......
/*
* 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.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
* 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.1
* (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
*
......@@ -2666,3 +2666,75 @@ int get_db_dl_PathlossChange(uint8_t dl_PathlossChange)
break;
}
}
SLSS_t *ue_get_slss(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t subframe_tx) {
return((SLSS_t*)NULL);
}
SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t subframe_tx) {
return((SLDCH_t*)NULL);
}
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;
uint32_t absSF = (frameP*10)+subframeP;
UE_MAC_INST *ue = &UE_mac_inst[module_idP];
int rvtab[4] = {0,2,3,1};
int sdu_length;
// Note: this is hard-coded for now for the default SL configuration (4 SF PSCCH, 36 SF PSSCH)
SLSCH_t *slsch = &UE_mac_inst[module_idP].slsch;
LOG_D(MAC,"Checking SLSCH for absSF %d\n",absSF);
if ((absSF%40) == 0) { // fill PSCCH data later in first subframe of SL period
ue->sltx_active = 0;
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
3,
0xFFFF);
if (rlc_status.bytes_in_buffer > 0) {
LOG_I(MAC,"Scheduling for %d bytes in Sidelink buffer\n",rlc_status.bytes_in_buffer);
// Fill in group id for off-network communications
ue->sltx_active = 1;
}
} // we're not in the SCCH period
else if (((absSF & 3) == 0 ) &&
(ue->sltx_active == 1)) { // every 4th subframe, check for new data from RLC
// 10 PRBs, mcs 19
int TBS = 4584/8;
int req;
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
3,
0xFFFF);
if (TBS<=rlc_status.bytes_in_buffer) req=TBS;
else req = rlc_status.bytes_in_buffer;
sdu_length = mac_rlc_data_req(module_idP,
0x1234,
0,
frameP,
ENB_FLAG_NO,
MBMS_FLAG_NO,
3,
req,
(char*)ue->slsch_pdu.payload);
LOG_I(MAC,"got %d bytes from Sidelink buffer (%d requested)\n",sdu_length,req);
if (sdu_length > 0) {
slsch->payload = (unsigned char*)ue->slsch_pdu.payload;
slsch->rvidx = 0;
// fill in SLSCH configuration
return(&ue->slsch);
}
else { // handle retransmission of SDU
slsch->rvidx = rvtab[absSF&3];
return(&ue->slsch);
}
}
return(NULL);
}
......@@ -1701,6 +1701,7 @@ rrc_pdcp_config_req (
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
pdcp_p->is_ue = TRUE;
pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id] = ctxt_pP->rnti;
} else {
pdcp_p->is_ue = FALSE;
}
......@@ -1719,7 +1720,7 @@ rrc_pdcp_config_req (
}
pdcp_p->first_missing_pdu = -1;
LOG_D(PDCP,PROTOCOL_PDCP_CTXT_FMT" Config request : Action ADD: radio bearer id %d (already added) configured\n",
LOG_I(PDCP,PROTOCOL_PDCP_CTXT_FMT" Config request : Action ADD: radio bearer id %d (already added) configured\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p),
rb_idP);
break;
......@@ -1778,10 +1779,10 @@ rrc_pdcp_config_req (
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
pdcp_p->is_ue = TRUE;
pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id] = ctxt_pP->rnti;
} else {
pdcp_p->is_ue = FALSE;
}
}
pdcp_p->next_pdcp_tx_sn = 0;
pdcp_p->next_pdcp_rx_sn = 0;
......@@ -1798,9 +1799,9 @@ rrc_pdcp_config_req (
}
pdcp_p->first_missing_pdu = -1;
LOG_D(PDCP,PROTOCOL_PDCP_CTXT_FMT" Inserting PDCP instance in collection key 0x%"PRIx64"\n",
LOG_I(PDCP,PROTOCOL_PDCP_CTXT_FMT" Inserting PDCP instance in collection key 0x%"PRIx64"\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p), key);
LOG_D(PDCP,PROTOCOL_PDCP_CTXT_FMT" Config request : Action ADD: radio bearer id %d configured\n",
LOG_I(PDCP,PROTOCOL_PDCP_CTXT_FMT" Config request : Action ADD: radio bearer id %d configured\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p),
rb_idP);
}
......
......@@ -421,7 +421,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
AssertFatal (rab_id < maxDRB, "RB id is too high (%u/%d)!\n", rab_id, maxDRB);
if (rab_id != 0) {
LOG_D(PDCP, "[FRAME %05d][%s][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ "
LOG_I(PDCP, "[FRAME %05d][%s][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ "
"/ %d Bytes --->][PDCP][MOD %u][RB %u]\n",
ctxt_cpy.frame,
(ctxt_cpy.enb_flag) ? "eNB" : "UE",
......@@ -583,7 +583,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
ctxt.enb_flag = ctxt_cpy.enb_flag;
#ifdef PDCP_DEBUG
LOG_D(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d\n", pdcp_read_header_g.rb_id);
LOG_I(PDCP, "[PDCP][NETLINK] pdcp_read_header_g.rb_id = %d\n", pdcp_read_header_g.rb_id);
#endif
if (ctxt_cpy.enb_flag) {
......@@ -682,13 +682,13 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
} else { // enb_flag
if (rab_id != 0) {
if (rab_id == UE_IP_DEFAULT_RAB_ID) {
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n",
LOG_I(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n",
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);
} else {
rab_id = rab_id % maxDRB;
LOG_D(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",
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);
......@@ -697,14 +697,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
if (h_rc == HASH_TABLE_OK) {
rab_id = pdcp_p->rb_id;
#ifdef PDCP_DEBUG
LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
LOG_I(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
ctxt.frame,
pdcp_read_header_g.inst,
len,
nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr),
pdcp_read_header_g.rb_id);
LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
LOG_I(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
ctxt.frame,
pdcp_read_header_g.inst,
pdcp_read_header_g.rb_id,
......
......@@ -37,7 +37,7 @@
#include "assertions.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
//#define DEBUG_MAC_INTERFACE 1
#define DEBUG_MAC_INTERFACE 1
//-----------------------------------------------------------------------------
struct mac_data_ind mac_rlc_deserialize_tb (
......@@ -143,7 +143,7 @@ tbs_size_t mac_rlc_data_req(
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_DATA_REQ,VCD_FUNCTION_IN);
#ifdef DEBUG_MAC_INTERFACE
LOG_D(RLC, PROTOCOL_CTXT_FMT" MAC_RLC_DATA_REQ channel %d (%d) MAX RB %d, Num_tb %d\n",
LOG_I(RLC, PROTOCOL_CTXT_FMT" MAC_RLC_DATA_REQ channel %d (%d) MAX RB %d, Num_tb %d\n",
PROTOCOL_CTXT_ARGS((&ctxt)),
channel_idP,
RLC_MAX_LC,
......@@ -390,7 +390,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
rlc_mode = rlc_union_p->mode;
} else {
rlc_mode = RLC_MODE_NONE;
//LOG_W(RLC , "[%s] RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
LOG_W(RLC , "[%s] RLC not configured lcid %u module %u!\n", __FUNCTION__, channel_idP, module_idP);
//LOG_D(RLC , "[%s] RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
}
......
......@@ -691,11 +691,16 @@ typedef struct UE_RRC_INST_s {
SystemInformationBlockType9_t *sib9[NB_CNX_UE];
SystemInformationBlockType10_t *sib10[NB_CNX_UE];
SystemInformationBlockType11_t *sib11[NB_CNX_UE];
uint8_t *MIB;
#ifdef Rel14
//TTN - SIB18
SystemInformationBlockType18_r12_t *sib18[NB_CNX_UE];
SystemInformationBlockType19_r12_t *sib19[NB_CNX_UE];
uint8_t *MIB;
SBCCH_SL_BCH_MessageType_t mib_sl[NB_CNX_UE];
/// Preconfiguration for Sidelink
struct SL_Preconfiguration_r12 *SL_Preconfiguration[NB_CNX_UE];
#endif
#if defined(Rel10) || defined(Rel14)
uint8_t MBMS_flag;
......
......@@ -183,8 +183,7 @@ void rrc_ue_process_sidelink_radioResourceConfig(
/** \brief Init control socket to listen to incoming packets from ProSe App
*
*/
void
rrc_control_socket_init();
void rrc_control_socket_init(void);
// eNB/CH RRC Procedures
......
......@@ -88,6 +88,11 @@
#include "SIMULATION/TOOLS/defs.h" // for taus
#ifdef Rel14
#include "SL-Preconfiguration-r12.h"
#endif
//TTN - for D2D
#define D2D_MODE //enable d2d
int ctrl_sock_fd;
......@@ -249,7 +254,7 @@ static int rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_t subState )
}
//-----------------------------------------------------------------------------
static void init_SI_UE( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
void init_SI_UE( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
{
UE_rrc_inst[ctxt_pP->module_id].sizeof_SIB1[eNB_index] = 0;
UE_rrc_inst[ctxt_pP->module_id].sizeof_SI[eNB_index] = 0;
......@@ -277,10 +282,109 @@ static void init_SI_UE( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIcnt = 0;
}
#ifdef Rel14
void init_SL_preconfig(UE_RRC_INST *UE, const uint8_t eNB_index )
{
LOG_I(RRC,"Initializing Sidelink Pre-configuration for UE\n");
UE->SL_Preconfiguration[eNB_index] = malloc16_clear( sizeof(struct SL_Preconfiguration_r12) );
UE->SL_Preconfiguration[eNB_index]->preconfigGeneral_r12.rohc_Profiles_r12.profile0x0001_r12 = true;
UE->SL_Preconfiguration[eNB_index]->preconfigGeneral_r12.carrierFreq_r12 = 3350;
UE->SL_Preconfiguration[eNB_index]->preconfigGeneral_r12.maxTxPower_r12 = 0;
UE->SL_Preconfiguration[eNB_index]->preconfigGeneral_r12.additionalSpectrumEmission_r12 = 0;
UE->SL_Preconfiguration[eNB_index]->preconfigGeneral_r12.sl_bandwidth_r12 = SL_PreconfigGeneral_r12__sl_bandwidth_r12_n50;
UE->SL_Preconfiguration[eNB_index]->preconfigGeneral_r12.tdd_ConfigSL_r12.subframeAssignmentSL_r12 = TDD_ConfigSL_r12__subframeAssignmentSL_r12_none;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.syncCP_Len_r12 = SL_CP_Len_r12_normal;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.syncOffsetIndicator1_r12 = 0;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.syncOffsetIndicator2_r12 = 0;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.syncTxParameters_r12 = 0;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.syncTxThreshOoC_r12 = 0;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.filterCoefficient_r12 = FilterCoefficient_fc0;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.syncRefMinHyst_r12 = SL_PreconfigSync_r12__syncRefMinHyst_r12_dB0;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.syncRefDiffHyst_r12 = SL_PreconfigSync_r12__syncRefDiffHyst_r12_dB0;
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.ext1 = malloc16_clear(sizeof(struct SL_PreconfigSync_r12__ext1));
UE->SL_Preconfiguration[eNB_index]->preconfigSync_r12.ext1->syncTxPeriodic_r13 = NULL;
struct SL_PreconfigCommPool_r12 *preconfigpool = malloc16_clear(sizeof(struct SL_PreconfigCommPool_r12));
preconfigpool->sc_CP_Len_r12 = SL_CP_Len_r12_normal;
preconfigpool->sc_Period_r12 = SL_PeriodComm_r12_sf40;
// 20 PRBs for SL communications
preconfigpool->sc_TF_ResourceConfig_r12.prb_Num_r12 = 20;
preconfigpool->sc_TF_ResourceConfig_r12.prb_Start_r12 = 5;
preconfigpool->sc_TF_ResourceConfig_r12.prb_End_r12 = 44;
// Offset set to 0 subframes
preconfigpool->sc_TF_ResourceConfig_r12.offsetIndicator_r12.present = SL_OffsetIndicator_r12_PR_small_r12;
preconfigpool->sc_TF_ResourceConfig_r12.offsetIndicator_r12.choice.small_r12 = 0;
// 40 ms SL Period
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.present = SubframeBitmapSL_r12_PR_bs40_r12;
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf = CALLOC(1,5);
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.size = 5;
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.bits_unused = 0;
// 1st 4 subframes for PSCCH
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[0] = 0xF;
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[1] = 0;
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[2] = 0;
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[3] = 0;
preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[4] = 0;
preconfigpool->sc_TxParameters_r12 = 0;
preconfigpool->data_CP_Len_r12 = SL_CP_Len_r12_normal;
// 20 PRBs for SL communications
preconfigpool->data_TF_ResourceConfig_r12.prb_Num_r12 = 20;
preconfigpool->data_TF_ResourceConfig_r12.prb_Start_r12 = 5;
preconfigpool->data_TF_ResourceConfig_r12.prb_End_r12 = 44;
// Offset set to 0 subframes
preconfigpool->data_TF_ResourceConfig_r12.offsetIndicator_r12.present = SL_OffsetIndicator_r12_PR_small_r12;
preconfigpool->data_TF_ResourceConfig_r12.offsetIndicator_r12.choice.small_r12 = 0;
// 40 ms SL Period
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.present = SubframeBitmapSL_r12_PR_bs40_r12;
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf = CALLOC(1,5);
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.size = 5;
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.bits_unused = 0;
// last 36 subframes for PSCCH
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[0] = 0xF0;
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[1] = 0xFF;
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[2] = 0xFF;
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[3] = 0xFF;
preconfigpool->data_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf[5] = 0xFF;
preconfigpool->dataHoppingConfig_r12.hoppingParameter_r12 = 0;
preconfigpool->dataHoppingConfig_r12.numSubbands_r12 = SL_HoppingConfigComm_r12__numSubbands_r12_ns1;
preconfigpool->dataHoppingConfig_r12.rb_Offset_r12 = 0;
preconfigpool->dataTxParameters_r12 = 0;
ASN_SEQUENCE_ADD(&UE->SL_Preconfiguration[eNB_index]->preconfigComm_r12.list,preconfigpool);
// Rel13 extensions
UE->SL_Preconfiguration[eNB_index]->ext1 = NULL;
// Establish a SLRB (using DRB for now)
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_NO, 0x1234, 0, 0,0);
rrc_pdcp_config_req (&ctxt,SRB_FLAG_NO, CONFIG_ACTION_ADD,
3, UNDEF_SECURITY_MODE);
rlc_info_t rlc_info;
rlc_info.rlc_mode = RLC_MODE_UM;
rlc_info.rlc.rlc_um_info.timer_reordering = 5;
rlc_info.rlc.rlc_um_info.sn_field_length = 10;
rlc_info.rlc.rlc_um_info.is_mXch = 0;
rrc_rlc_config_req(&ctxt,SRB_FLAG_NO,MBMS_FLAG_NO,CONFIG_ACTION_ADD,
3,
rlc_info);
}
#endif
#if defined(Rel10) || defined(Rel14)
//-----------------------------------------------------------------------------
#if 0
static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
{
int i;
UE_rrc_inst[ue_mod_idP].sizeof_MCCH_MESSAGE[eNB_index] = 0;
......@@ -296,7 +400,7 @@ static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
#endif
//-----------------------------------------------------------------------------
static void openair_rrc_ue_init_security( const protocol_ctxt_t* const ctxt_pP )
void openair_rrc_ue_init_security( const protocol_ctxt_t* const ctxt_pP )
{
#if defined(ENABLE_SECURITY)
// uint8_t *kRRCenc;
......@@ -349,6 +453,12 @@ char openair_rrc_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_
LOG_D(RRC,PROTOCOL_RRC_CTXT_FMT" INIT: phy_sync_2_ch_ind\n",
PROTOCOL_RRC_CTXT_ARGS(&ctxt));
#ifndef NO_RRM
send_msg(&S_rrc,msg_rrc_phy_synch_to_CH_ind(ctxt.module_id,eNB_index,UE_rrc_inst[ctxt.module_id].Mac_id));
#endif
#ifndef NO_RRM
send_msg(&S_rrc,msg_rrc_phy_synch_to_CH_ind(ctxt.module_id,eNB_index,UE_rrc_inst[ctxt.module_id].Mac_id));
#endif
......@@ -446,7 +556,7 @@ static const char const nas_attach_req_guti[] = {
#endif
//-----------------------------------------------------------------------------
static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id )
void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id )
{
uint8_t buffer[100];
......@@ -480,7 +590,7 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* c
}
//-----------------------------------------------------------------------------
static void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id )
void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id )
{
uint8_t buffer[32], size;
......@@ -2506,7 +2616,7 @@ const char SIBType[12][6] = {"SIB3","SIB4","SIB5","SIB6","SIB7","SIB8","SIB9","S
const char SIBPeriod[8][6]= {"rf8","rf16","rf32","rf64","rf128","rf256","rf512","ERR"};
int siPeriod_int[7] = {80,160,320,640,1280,2560,5120};
static const char* SIBreserved( long value )
const char* SIBreserved( long value )
{
if (value < 0 || value > 1)
return "ERR";
......@@ -2516,7 +2626,7 @@ static const char* SIBreserved( long value )
return "reserved";
}
static const char* SIBbarred( long value )
const char* SIBbarred( long value )
{
if (value < 0 || value > 1)
return "ERR";
......@@ -2526,7 +2636,7 @@ static const char* SIBbarred( long value )
return "barred";
}
static const char* SIBallowed( long value )
const char* SIBallowed( long value )
{
if (value < 0 || value > 1)
return "ERR";
......@@ -2536,7 +2646,7 @@ static const char* SIBallowed( long value )
return "allowed";
}
static const char* SIB2SoundingPresent( int value )
const char* SIB2SoundingPresent( int value )
{
switch (value) {
case SoundingRS_UL_ConfigCommon_PR_NOTHING:
......@@ -2551,7 +2661,7 @@ static const char* SIB2SoundingPresent( int value )
return "ERR";
}
static const char* SIB2numberOfRA_Preambles( long value )
const char* SIB2numberOfRA_Preambles( long value )
{
static char temp[4] = {0};
......@@ -2562,7 +2672,7 @@ static const char* SIB2numberOfRA_Preambles( long value )
temp[3] = 0; // terminate string
return temp;
}
static const char* SIB2powerRampingStep( long value )
const char* SIB2powerRampingStep( long value )
{
if (value < 0 || value > 3)
return "ERR";
......@@ -2570,7 +2680,7 @@ static const char* SIB2powerRampingStep( long value )
static const char str[4][4] = {"dB0","dB2","dB4","dB6"};
return str[value];
}
static const char* SIB2preambleInitialReceivedTargetPower( long value )
const char* SIB2preambleInitialReceivedTargetPower( long value )
{
static char temp[8] = {0};
......@@ -2581,7 +2691,7 @@ static const char* SIB2preambleInitialReceivedTargetPower( long value )
temp[7] = 0; // terminate string
return temp;
}
static const char* SIB2preambleTransMax( long value )
const char* SIB2preambleTransMax( long value )
{
static char temp[5] = {0};
......@@ -2613,7 +2723,7 @@ static const char* SIB2preambleTransMax( long value )
/* unreachable but gcc warns... */
return "ERR";
}
static const char* SIB2ra_ResponseWindowSize( long value )
const char* SIB2ra_ResponseWindowSize( long value )
{
static char temp[4] = {0};
......@@ -2626,7 +2736,7 @@ static const char* SIB2ra_ResponseWindowSize( long value )
snprintf( temp, sizeof(temp), "sf%ld", value+2 );
return temp;
}
static const char* SIB2mac_ContentionResolutionTimer( long value )
const char* SIB2mac_ContentionResolutionTimer( long value )
{
static char temp[5] = {0};
......@@ -2636,7 +2746,7 @@ static const char* SIB2mac_ContentionResolutionTimer( long value )
snprintf( temp, sizeof(temp), "sf%ld", 8 + value*8 );
return temp;
}
static const char* SIB2modificationPeriodCoeff( long value )
const char* SIB2modificationPeriodCoeff( long value )
{
static char temp[32] = {0};
......@@ -2646,7 +2756,7 @@ static const char* SIB2modificationPeriodCoeff( long value )
snprintf( temp, sizeof(temp), "n%d", (int)pow(2,value+1) );
return temp;
}
static const char* SIB2defaultPagingCycle( long value )
const char* SIB2defaultPagingCycle( long value )
{
static char temp[32] = {0};
......@@ -2656,7 +2766,7 @@ static const char* SIB2defaultPagingCycle( long value )
snprintf( temp, sizeof(temp), "rf%d", (int)pow(2,value+4) );
return temp;
}
static const char* SIB2nB( long value )
const char* SIB2nB( long value )
{
if (value < 0 || value > 7)
return "ERR";
......@@ -2834,7 +2944,7 @@ int decode_PCCH_DLSCH_Message(
}
//-----------------------------------------------------------------------------
static int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t rsrq, const uint8_t rsrp )
int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t rsrq, const uint8_t rsrp )
{
SystemInformationBlockType1_t* sib1 = UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index];
......@@ -3065,7 +3175,7 @@ static int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
//-----------------------------------------------------------------------------
static void dump_sib2( SystemInformationBlockType2_t *sib2 )
void dump_sib2( SystemInformationBlockType2_t *sib2 )
{
// ac_BarringInfo
if (sib2->ac_BarringInfo) {
......@@ -3306,7 +3416,7 @@ static void dump_sib2( SystemInformationBlockType2_t *sib2 )
}
//-----------------------------------------------------------------------------
static void dump_sib3( SystemInformationBlockType3_t *sib3 )
void dump_sib3( SystemInformationBlockType3_t *sib3 )
{
LOG_I( RRC, "Dumping SIB3 (see TS36.331 V8.21.0)\n" );
......@@ -3455,7 +3565,7 @@ uint64_t arfcn_to_freq(long arfcn) {
exit(1);
}
}
static void dump_sib5( SystemInformationBlockType5_t *sib5 )
void dump_sib5( SystemInformationBlockType5_t *sib5 )
{
InterFreqCarrierFreqList_t interFreqCarrierFreqList = sib5->interFreqCarrierFreqList;
int i,j;
......@@ -3548,7 +3658,7 @@ static void dump_sib5( SystemInformationBlockType5_t *sib5 )
}
#if defined(Rel10) || defined(Rel14)
static void dump_sib13( SystemInformationBlockType13_r9_t *sib13 )
void dump_sib13( SystemInformationBlockType13_r9_t *sib13 )
{
LOG_I( RRC, "[UE] Dumping SIB13\n" );
LOG_I( RRC, "[UE] dumping sib13 second time\n" );
......@@ -3560,7 +3670,7 @@ static void dump_sib13( SystemInformationBlockType13_r9_t *sib13 )
//TTN - SIB18
//-----------------------------------------------------------------------------
static void dump_sib18(SystemInformationBlockType18_r12_t *sib18){
void dump_sib18(SystemInformationBlockType18_r12_t *sib18){
LOG_I( RRC, "[UE] Dumping SIB18\n" );
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);
......@@ -3576,7 +3686,7 @@ static void dump_sib18(SystemInformationBlockType18_r12_t *sib18){
//TTN - SIB19
//-----------------------------------------------------------------------------
static void dump_sib19(SystemInformationBlockType19_r12_t *sib19){
void dump_sib19(SystemInformationBlockType19_r12_t *sib19){
LOG_I( RRC, "[UE] Dumping SIB19\n" );
for (int i = 0; i < sib19->discConfig_r12->discRxPool_r12.list.count; i++) {
LOG_I(RRC, " Contents of SIB18 %d/%d \n", i+1, sib19->discConfig_r12->discRxPool_r12.list.count);
......@@ -3592,7 +3702,7 @@ static void dump_sib19(SystemInformationBlockType19_r12_t *sib19){
}
//-----------------------------------------------------------------------------
static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
{
LOG_I( RRC, "Panos-D: decode_SI 1 \n");
//printf("Panos-D: decode_SI 1 \n");
......@@ -3980,7 +4090,7 @@ void ue_meas_filtering( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
//Below routine implements Measurement Reporting procedure from 36.331 Section 5.5.5
//-----------------------------------------------------------------------------
static void rrc_ue_generate_MeasurementReport(protocol_ctxt_t* const ctxt_pP, uint8_t eNB_index )
void rrc_ue_generate_MeasurementReport(protocol_ctxt_t* const ctxt_pP, uint8_t eNB_index )
{
uint8_t buffer[32], size;
......@@ -4174,7 +4284,7 @@ void ue_measurement_report_triggering(protocol_ctxt_t* const ctxt_pP, const uint
//check_trigger_meas_event(ue_mod_idP, frameP, eNB_index, i,j,ofn,ocn,hys,ofs,ocs,a3_offset,ttt_ms)
//-----------------------------------------------------------------------------
static uint8_t check_trigger_meas_event(
uint8_t check_trigger_meas_event(
module_id_t ue_mod_idP,
frame_t frameP,
uint8_t eNB_index,
......@@ -4301,7 +4411,7 @@ int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB
}
//-----------------------------------------------------------------------------
static void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_index, frame_t frameP, uint8_t mbsfn_sync_area )
void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_index, frame_t frameP, uint8_t mbsfn_sync_area )
{
protocol_ctxt_t ctxt;
......@@ -4903,6 +5013,11 @@ openair_rrc_top_init_ue(
}
#endif
#ifdef Rel14
init_SL_preconfig(&UE_rrc_inst[module_id],0);
#endif
} else {
UE_rrc_inst = NULL;
}
......@@ -5189,7 +5304,7 @@ rrc_control_socket_init(){
}
//--------------------------------------------------------
static void *rrc_control_socket_thread_fct(void *arg)
void *rrc_control_socket_thread_fct(void *arg)
{
int prose_addr_len;
......
......@@ -639,6 +639,7 @@ static void get_options(void) {
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
printf("get_options 0, UE_flag: %d", UE_flag);
......@@ -667,11 +668,13 @@ static void get_options(void) {
}
if (UE_flag > 0) {
// set default parameters
set_default_frame_parms(frame_parms);
uint8_t n_rb_dl;
paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC;
paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC;
set_default_frame_parms(frame_parms);
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
......@@ -687,67 +690,55 @@ static void get_options(void) {
printf("Panos: get_options 9 \n");
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
printf("Panos: get_options 10 \n");
if ( cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr != NULL) {
if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach;
if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect;
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
}
if ( (cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = debug_prach;
if ( (cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = no_L2_connect;
if ( (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = calib_prach_tx;
printf("Panos: get_options 11 \n");
if (dumpframe > 0) mode = rx_dump_frame;
if ( downlink_frequency[0][0] > 0) {
printf("Panos: get_options 8 \n");
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
downlink_frequency[CC_id][1] = downlink_frequency[0][0];
downlink_frequency[CC_id][2] = downlink_frequency[0][0];
downlink_frequency[CC_id][3] = downlink_frequency[0][0];
printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]);
printf("Downlink frequency set to %u\n", downlink_frequency[0][0]);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
}
UE_scan=0;
}
printf("Panos: get_options 15 \n");
if (tddflag > 0) {
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
frame_parms[CC_id]->frame_type = TDD;
}
printf("Panos: get_options 16 \n");
if (frame_parms != NULL){
printf("Panos: get_options 17 \n");
if (frame_parms[0]->N_RB_DL !=0) {
printf("Panos: get_options 17 \n");
if ( frame_parms[0]->N_RB_DL < 6 ) {
frame_parms[0]->N_RB_DL = 6;
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
if (n_rb_dl !=0) {
printf("NB_RB set to %d\n",n_rb_dl);
if ( n_rb_dl < 6 ) {
n_rb_dl = 6;
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",n_rb_dl);
}
if ( frame_parms[0]->N_RB_DL > 100 ) {
frame_parms[0]->N_RB_DL = 100;
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
if ( n_rb_dl > 100 ) {
n_rb_dl = 100;
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",n_rb_dl);
}
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
frame_parms[0]->N_RB_DL = 50;
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
if ( n_rb_dl > 50 && n_rb_dl < 100 ) {
n_rb_dl = 50;
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",n_rb_dl);
}
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
frame_parms[0]->N_RB_DL = 25;
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
if ( n_rb_dl > 25 && n_rb_dl < 50 ) {
n_rb_dl = 25;
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",n_rb_dl);
}
UE_scan = 0;
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
}
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->N_RB_DL=n_rb_dl;
frame_parms[CC_id]->N_RB_UL=n_rb_dl;
}
}
printf("Panos: get_options 17 \n");
for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++) {
tx_max_power[CC_id]=tx_max_power[0];
rx_gain[0][CC_id] = rx_gain[0][0];
tx_gain[0][CC_id] = tx_gain[0][0];
}
printf("Panos: get_options 6 \n");
} /* UE_flag > 0 */
#if T_TRACER
paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ;
......@@ -767,7 +758,7 @@ static void get_options(void) {
// Here the configuration file is the XER encoded UE capabilities
// Read it in and store in asn1c data structures
strcpy(uecap_xer,CONFIG_GETCONFFILE);
uecap_xer_in=1;
uecap_xer_in=0;
printf("Panos: get_options 7 \n");
} /* UE with config file */
}
......@@ -976,9 +967,15 @@ int main( int argc, char **argv )
get_options ();
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
if (UE_flag == 0) {
fprintf(stderr,"Getting configuration failed\n");
exit(-1);
}
else {
printf("Setting nfapi mode to UE_STUB_OFFNET\n");
nfapi_mode = 4;
}
}
#if T_TRACER
......@@ -993,10 +990,10 @@ int main( int argc, char **argv )
if (UE_flag==1) {
printf("configuring for UE\n");
set_comp_log(HW, LOG_DEBUG, LOG_HIGH, 1);
set_comp_log(PHY, LOG_DEBUG, LOG_HIGH, 1);
set_comp_log(MAC, LOG_INFO, LOG_HIGH, 1);
set_comp_log(RLC, LOG_INFO, LOG_HIGH | FLAG_THREAD, 1);
set_comp_log(HW, LOG_INFO, LOG_HIGH, 1);
set_comp_log(PHY, LOG_INFO, LOG_HIGH, 1);
set_comp_log(MAC, LOG_TRACE, LOG_HIGH, 1);
set_comp_log(RLC, LOG_TRACE, LOG_HIGH | FLAG_THREAD, 1);
set_comp_log(PDCP, LOG_INFO, LOG_HIGH, 1);
set_comp_log(OTG, LOG_INFO, LOG_HIGH, 1);
set_comp_log(RRC, LOG_INFO, LOG_HIGH, 1);
......@@ -1223,7 +1220,7 @@ int main( int argc, char **argv )
printf("cannot create ITTI tasks\n");
exit(-1); // need a softer mode
}
UE_config_stub_pnf();
// UE_config_stub_pnf();
printf("ITTI tasks created\n");
}
else {
......@@ -1331,14 +1328,17 @@ int main( int argc, char **argv )
case 3:
nfapi_mode_str = "UE_STUB_PNF";
break;
case 4:
nfapi_mode_str = "UE_STUB_OFFNET";
break;
default:
nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
break;
}
printf("NFAPI MODE:%s\n", nfapi_mode_str);
// Panos: We should never enter here since we are always going to run with nfapi_mode=3
if (nfapi_mode==2) // VNF
if (nfapi_mode<3) // VNF
wait_nfapi_init("main?");
printf("START MAIN THREADS\n");
......
......@@ -607,9 +607,12 @@ static void get_options(void) {
if (UE_flag > 0) {
uint8_t n_rb_dl;
nfapi_mode=0;
paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC;
paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC;
set_default_frame_parms(frame_parms);
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
......@@ -623,17 +626,15 @@ static void get_options(void) {
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue;
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med;
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach;
if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect;
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
if ( (cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = debug_prach;
if ( (cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = no_L2_connect;
if ( (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = calib_prach_tx;
if (dumpframe > 0) mode = rx_dump_frame;
if ( downlink_frequency[0][0] > 0) {
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
downlink_frequency[CC_id][1] = downlink_frequency[0][0];
downlink_frequency[CC_id][2] = downlink_frequency[0][0];
downlink_frequency[CC_id][3] = downlink_frequency[0][0];
printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]);
printf("Downlink frequency set to %u\n", downlink_frequency[0][0]);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
}
UE_scan=0;
}
......@@ -643,28 +644,28 @@ static void get_options(void) {
frame_parms[CC_id]->frame_type = TDD;
}
if (frame_parms[0]->N_RB_DL !=0) {
if ( frame_parms[0]->N_RB_DL < 6 ) {
frame_parms[0]->N_RB_DL = 6;
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
if (n_rb_dl !=0) {
printf("NB_RB set to %d\n",n_rb_dl);
if ( n_rb_dl < 6 ) {
n_rb_dl = 6;
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",n_rb_dl);
}
if ( frame_parms[0]->N_RB_DL > 100 ) {
frame_parms[0]->N_RB_DL = 100;
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
if ( n_rb_dl > 100 ) {
n_rb_dl = 100;
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",n_rb_dl);
}
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
frame_parms[0]->N_RB_DL = 50;
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
if ( n_rb_dl > 50 && n_rb_dl < 100 ) {
n_rb_dl = 50;
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",n_rb_dl);
}
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
frame_parms[0]->N_RB_DL = 25;
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
if ( n_rb_dl > 25 && n_rb_dl < 50 ) {
n_rb_dl = 25;
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",n_rb_dl);
}
UE_scan = 0;
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->N_RB_DL=n_rb_dl;
frame_parms[CC_id]->N_RB_UL=n_rb_dl;
}
}
......@@ -693,7 +694,7 @@ static void get_options(void) {
// Here the configuration file is the XER encoded UE capabilities
// Read it in and store in asn1c data structures
strcpy(uecap_xer,CONFIG_GETCONFFILE);
uecap_xer_in=1;
// uecap_xer_in=1;
} /* UE with config file */
}
......@@ -938,13 +939,13 @@ int main( int argc, char **argv )
// set default parameters
if (UE_flag == 1) set_default_frame_parms(frame_parms);
//if (UE_flag == 1) set_default_frame_parms(frame_parms);
logInit();
printf("Reading in command-line options\n");
get_options ();
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
if (CONFIG_ISFLAGSET(CONFIG_ABORT) && UE_flag == 0) {
fprintf(stderr,"Getting configuration failed\n");
exit(-1);
}
......@@ -1055,7 +1056,6 @@ int main( int argc, char **argv )
printf("Before CC \n");
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
......@@ -1115,11 +1115,10 @@ int main( int argc, char **argv )
else if (frame_parms[CC_id]->N_RB_DL == 25)
UE[CC_id]->N_TA_offset = 624/4;
}
init_openair0();
}
}
printf("Runtime table\n");
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
cpuf=get_cpu_freq_GHz();
......@@ -1168,10 +1167,6 @@ int main( int argc, char **argv )
#if defined(ENABLE_ITTI)
printf("ITTI enabled\n");
printf("UE_flag:%d\n", UE_flag);
printf("RC.nb_inst:%d\n", RC.nb_inst);
if ((UE_flag == 1)||
(RC.nb_inst > 0)) {
......@@ -1189,14 +1184,6 @@ int main( int argc, char **argv )
}
#endif
if (phy_test==0) {
if (UE_flag==1) {
printf("Filling UE band info\n");
fill_ue_band_info();
dl_phy_sync_success (0, 0, 0, 1);
}
}
mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_cond_init(&sync_cond,NULL);
......@@ -1298,6 +1285,12 @@ int main( int argc, char **argv )
if (UE_flag == 1) {
int eMBMS_active = 0;
init_UE(1,eMBMS_active,uecap_xer_in);
if (phy_test==0) {
printf("Filling UE band info\n");
fill_ue_band_info();
dl_phy_sync_success (0, 0, 0, 1);
}
number_of_cards = 1;
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
......@@ -1315,10 +1308,8 @@ int main( int argc, char **argv )
// for (CC_id=0;CC_id<RC.nb_L1_CC[inst];CC_id++) phy_init_lte_eNB(RC.eNB[inst][CC_id],0,0);
}
printf("wait_eNBs()\n");
wait_eNBs();
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
if (RC.nb_RU >0) {
printf("Initializing RU threads\n");
init_RU(rf_config_file);
......
......@@ -127,7 +127,7 @@
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:0, TYPE_UINT8, 0}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&n_rb_dl, defintval:0, TYPE_UINT8, 0}, \
}
......
......@@ -765,7 +765,7 @@ static void *UE_thread_rxn_txnp4(void *arg) {
}
}
// thread finished
// thread finished
free(arg);
return &UE_thread_rxtx_retval;
}
......@@ -866,33 +866,35 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
(sf_type==SF_S ? "SF_S" : "UNKNOWN_SF_TYPE"))));
}
/*
#ifdef UE_SLOT_PARALLELISATION
phy_procedures_UE_SL_RX(UE,proc);
/*
#ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
#else
*/
#else
*/
// Panos: Substitute call to phy_procedures Rx with call to phy_stub functions in order to trigger
// UE Rx procedures directly at the MAC layer, based on the received nfapi requests from the vnf (eNB).
// Hardcode Mod_id for now. Will be changed later.
// Panos: is this the right place to call oai_subframe_indication to invoke p7 nfapi callbacks here?
oai_subframe_ind(proc->frame_rx, proc->subframe_rx);
LOG_I( MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind \n");
LOG_D( MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind \n");
//printf("Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind \n");
/*if(UE_mac_inst[Mod_id].tx_req!= NULL){
printf("Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind 2\n");
tx_req_UE_MAC(UE_mac_inst[Mod_id].tx_req);
}*/
if(UE_mac_inst[Mod_id].dl_config_req!= NULL) {
LOG_I( MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind 3 \n");
LOG_D( MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind 3 \n");
dl_config_req_UE_MAC(UE_mac_inst[Mod_id].dl_config_req);
}
if(UE_mac_inst[Mod_id].hi_dci0_req!= NULL){
LOG_I( MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind 4 \n");
LOG_D( MAC, "Panos-D: UE_phy_stub_thread_rxn_txnp4 after oai_subframe_ind 4 \n");
hi_dci0_req_UE_MAC(UE_mac_inst[Mod_id].hi_dci0_req);
}
//#endif
phy_procedures_UE_SL_TX(UE,proc);
//#endif
}
#if UE_TIMING_TRACE
......@@ -946,7 +948,7 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
}
}
phy_procedures_UE_SL_RX(UE,proc);
/*if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) &&
......@@ -970,7 +972,7 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
}
}
// thread finished
// thread finished
free(arg);
return &UE_thread_rxtx_retval;
}
......@@ -1330,8 +1332,8 @@ void init_UE_threads_stub(int inst) {
UE->proc.proc_rxtx[i].sub_frame_step=nb_threads;
printf("Init_UE_threads rtd %d proc %d nb_threads %d i %d\n",rtd->proc->sub_frame_start, UE->proc.proc_rxtx[i].sub_frame_start,nb_threads, i);
pthread_create(&UE->proc.proc_rxtx[i].pthread_rxtx, NULL, UE_phy_stub_thread_rxn_txnp4, rtd);
/*
#ifdef UE_SLOT_PARALLELISATION
/*
#ifdef UE_SLOT_PARALLELISATION
//pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_slot0_dl_processing,NULL);
//pthread_cond_init(&UE->proc.proc_rxtx[i].cond_slot0_dl_processing,NULL);
//pthread_create(&UE->proc.proc_rxtx[i].pthread_slot0_dl_processing,NULL,UE_thread_slot0_dl_processing, rtd);
......@@ -1339,18 +1341,18 @@ void init_UE_threads_stub(int inst) {
pthread_mutex_init(&UE->proc.proc_rxtx[i].mutex_slot1_dl_processing,NULL);
pthread_cond_init(&UE->proc.proc_rxtx[i].cond_slot1_dl_processing,NULL);
pthread_create(&UE->proc.proc_rxtx[i].pthread_slot1_dl_processing,NULL,UE_thread_slot1_dl_processing, rtd);
#endif*/
#endif*/
}
// Panos: Remove thread for UE_sync in phy_stub_UE mode.
//pthread_create(&UE->proc.pthread_synch,NULL,UE_thread_synch,(void*)UE);
}
}
#ifdef OPENAIR2
void fill_ue_band_info(void) {
void fill_ue_band_info(void) {
UE_EUTRA_Capability_t *UE_EUTRA_Capability = UE_rrc_inst[0].UECap->UE_EUTRA_Capability;
int i,j;
......@@ -1376,10 +1378,10 @@ void fill_ue_band_info(void) {
break;
}
}
}
}
#endif
int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg) {
int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg) {
int i, CC_id;
LTE_DL_FRAME_PARMS *frame_parms;
......@@ -1417,13 +1419,13 @@ int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg)
// because no "release_ue_buffers"-function is available, at least rxdata and txdata memory will leak (only some bytes)
}
return 0;
}
}
// Panos: This timer thread is used only in the phy_sub mode as an independent timer
// which will be ticking and provide the SFN/SF values that will be used from the UE threads
// playing the role of nfapi-pnf.
static void* timer_thread( void* param ) {
// Panos: This timer thread is used only in the phy_sub mode as an independent timer
// which will be ticking and provide the SFN/SF values that will be used from the UE threads
// playing the role of nfapi-pnf.
static void* timer_thread( void* param ) {
thread_top_init("timer_thread",1,870000L,1000000L,1000000L);
timer_subframe =9;
timer_frame =1023;
......@@ -1452,7 +1454,7 @@ static void* timer_thread( void* param ) {
timer_subframe++;
}
//printf("[timer_thread] Frame: %d, Subframe: %d \n", timer_frame, timer_subframe);
LOG_I(MAC," Panos-D [timer_thread] Frame: %d, Subframe: %d \n", timer_frame, timer_subframe);
LOG_D(MAC," Panos-D [timer_thread] Frame: %d, Subframe: %d \n", timer_frame, timer_subframe);
//AssertFatal( 0 == pthread_cond_signal(&phy_stub_ticking->cond_ticking), "");
AssertFatal(pthread_mutex_lock(&phy_stub_ticking->mutex_ticking) ==0,"");
phy_stub_ticking->ticking_var++;
......@@ -1487,7 +1489,7 @@ static void* timer_thread( void* param ) {
t_diff = get_time_meas_us(&UE->timer_stats);
//printf("Panos-D: Absolute time: %lld, diff: %lld, diff_now: %lld \n",UE->timer_stats.p_time, UE->timer_stats.diff, UE->timer_stats.diff_now);
//LOG_I(MAC,"[UE%d] Applying default macMainConfig\n",module_idP);
if (t_diff > 1100) LOG_E(MAC," Panos-D Absolute time: %f\n", t_diff);
//if (t_diff > 1100) LOG_E(MAC," Panos-D Absolute time: %f\n", t_diff);
//printf("Panos-D: Absolute time: %f", t_diff);
//UE->proc.ticking_var++;
......@@ -1499,15 +1501,15 @@ static void* timer_thread( void* param ) {
pthread_mutex_destroy(&phy_stub_ticking->mutex_ticking);
return 0;
}
}
int init_timer_thread(void) {
int init_timer_thread(void) {
phy_stub_ticking = (SF_ticking*)malloc(sizeof(SF_ticking));
pthread_mutex_init(&phy_stub_ticking->mutex_ticking,NULL);
pthread_cond_init(&phy_stub_ticking->cond_ticking,NULL);
pthread_create(phy_stub_ticking->pthread_timer, NULL, &timer_thread, NULL);
return 0;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment