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 ...@@ -1096,6 +1096,9 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.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/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
...@@ -1946,7 +1949,7 @@ add_executable(lte-softmodem-stub ...@@ -1946,7 +1949,7 @@ add_executable(lte-softmodem-stub
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
#${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI} ${GTPU_need_ITTI}
......
...@@ -864,11 +864,80 @@ typedef enum { ...@@ -864,11 +864,80 @@ typedef enum {
} RX_type_t; } RX_type_t;
#ifdef Rel14
typedef enum { typedef enum {
DCI_COMMON_SPACE, DCI_COMMON_SPACE,
DCI_UE_SPACE DCI_UE_SPACE
} dci_space_t; } 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 #endif
...@@ -1479,6 +1479,23 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1479,6 +1479,23 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
DCI_ALLOC_t *dci_alloc, DCI_ALLOC_t *dci_alloc,
uint8_t subframe); 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_64qam_table(void);
void generate_16qam_table(void); void generate_16qam_table(void);
......
...@@ -137,6 +137,8 @@ static inline void* malloc16_clear( size_t size ) ...@@ -137,6 +137,8 @@ static inline void* malloc16_clear( size_t size )
#include "targets/ARCH/COMMON/common_lib.h" #include "targets/ARCH/COMMON/common_lib.h"
#include "targets/COMMON/openairinterface5g_limits.h" #include "targets/COMMON/openairinterface5g_limits.h"
#include "openair2/LAYER2/MAC/defs.h"
#if defined(EXMIMO) || defined(OAI_USRP) #if defined(EXMIMO) || defined(OAI_USRP)
//#define NUMBER_OF_eNB_MAX 1 //#define NUMBER_OF_eNB_MAX 1
//#define NUMBER_OF_UE_MAX 16 //#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 ...@@ -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 @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); 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, 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, uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,
relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn); 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 ...@@ -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) { 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 ...@@ -4757,6 +4778,11 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr
#endif #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, 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, uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,
relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) {
......
...@@ -69,8 +69,9 @@ ...@@ -69,8 +69,9 @@
#endif #endif
#ifdef Rel14 #ifdef Rel14
#include "SystemInformationBlockType1-v1310-IEs.h" #include "SystemInformationBlockType1-v1310-IEs.h"
#include "SystemInformationBlockType18-r12.h"
#endif #endif
#include "RadioResourceConfigCommonSIB.h"
#include "nfapi_interface.h" #include "nfapi_interface.h"
#include "PHY_INTERFACE/IF_Module.h" #include "PHY_INTERFACE/IF_Module.h"
...@@ -978,7 +979,7 @@ typedef struct { ...@@ -978,7 +979,7 @@ typedef struct {
/*! \brief subband bitmap confguration (for ALU icic algo purpose), in test phase */ /*! \brief subband bitmap confguration (for ALU icic algo purpose), in test phase */
typedef struct { 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 periodicity;
uint8_t first_subframe; uint8_t first_subframe;
uint8_t sb_size; uint8_t sb_size;
...@@ -1266,6 +1267,22 @@ typedef struct { ...@@ -1266,6 +1267,22 @@ typedef struct {
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
/// pointer to RRC PHY configuration SCEll /// pointer to RRC PHY configuration SCEll
struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10; 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 #endif
/// pointer to TDD Configuration (NULL for FDD) /// pointer to TDD Configuration (NULL for FDD)
TDD_Config_t *tdd_Config; TDD_Config_t *tdd_Config;
...@@ -1298,6 +1315,11 @@ typedef struct { ...@@ -1298,6 +1315,11 @@ typedef struct {
RAR_PDU RAR_pdu; RAR_PDU RAR_pdu;
/// Incoming DLSCH pdu for PHY /// Incoming DLSCH pdu for PHY
DLSCH_PDU DLSCH_pdu[NUMBER_OF_UE_MAX][2]; 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 /// number of attempt for rach
uint8_t RA_attempt_number; uint8_t RA_attempt_number;
/// Random-access procedure flag /// Random-access procedure flag
...@@ -1409,6 +1431,8 @@ typedef struct { ...@@ -1409,6 +1431,8 @@ typedef struct {
uint8_t n_adj_cells; uint8_t n_adj_cells;
} neigh_cell_id_t; } neigh_cell_id_t;
#include "proto.h" #include "proto.h"
/*@}*/ /*@}*/
#endif /*__LAYER2_MAC_DEFS_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 ...@@ -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 eNB_id Index of eNB that UE is attached to
@param rnti C_RNTI of UE @param rnti C_RNTI of UE
@param subframe subframe number @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); 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) /* \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 Index of UE instance
@param Mod_id Component Carrier Index @param Mod_id Component Carrier Index
......
/* /*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more * Licensed to the OpenAirInterface (OAI) Software Alliance under one
* contributor license agreements. See the NOTICE file distributed with * or more contributor license agreements. See the NOTICE file
* this work for additional information regarding copyright ownership. * distributed with this work for additional information regarding
* The OpenAirInterface Software Alliance licenses this file to You under * copyright ownership. The OpenAirInterface Software Alliance
* the OAI Public License, Version 1.1 (the "License"); you may not use this file * licenses this file to You under the OAI Public License, Version 1.1
* except in compliance with the License. * (the "License"); you may not use this file except in compliance
* You may obtain a copy of the License at * with the License. You may obtain a copy of the License at
* *
* http://www.openairinterface.org/?page_id=698 * http://www.openairinterface.org/?page_id=698
* *
...@@ -1493,14 +1493,14 @@ for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid ...@@ -1493,14 +1493,14 @@ for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].crnti,
eNB_index, eNB_index,
frameP, frameP,
ENB_FLAG_NO, ENB_FLAG_NO,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
buflen_remain, buflen_remain,
(char *)&ulsch_buff[sdu_length_total]); (char *)&ulsch_buff[sdu_length_total]);
AssertFatal (buflen_remain >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n", AssertFatal (buflen_remain >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
...@@ -2666,3 +2666,75 @@ int get_db_dl_PathlossChange(uint8_t dl_PathlossChange) ...@@ -2666,3 +2666,75 @@ int get_db_dl_PathlossChange(uint8_t dl_PathlossChange)
break; 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 ( ...@@ -1701,6 +1701,7 @@ rrc_pdcp_config_req (
if (ctxt_pP->enb_flag == ENB_FLAG_NO) { if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
pdcp_p->is_ue = TRUE; pdcp_p->is_ue = TRUE;
pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id] = ctxt_pP->rnti;
} else { } else {
pdcp_p->is_ue = FALSE; pdcp_p->is_ue = FALSE;
} }
...@@ -1719,9 +1720,9 @@ rrc_pdcp_config_req ( ...@@ -1719,9 +1720,9 @@ rrc_pdcp_config_req (
} }
pdcp_p->first_missing_pdu = -1; 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), PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p),
rb_idP); rb_idP);
break; break;
case CONFIG_ACTION_MODIFY: case CONFIG_ACTION_MODIFY:
...@@ -1778,10 +1779,10 @@ rrc_pdcp_config_req ( ...@@ -1778,10 +1779,10 @@ rrc_pdcp_config_req (
if (ctxt_pP->enb_flag == ENB_FLAG_NO) { if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
pdcp_p->is_ue = TRUE; pdcp_p->is_ue = TRUE;
pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id] = ctxt_pP->rnti;
} else { } else {
pdcp_p->is_ue = FALSE; pdcp_p->is_ue = FALSE;
} }
pdcp_p->next_pdcp_tx_sn = 0; pdcp_p->next_pdcp_tx_sn = 0;
pdcp_p->next_pdcp_rx_sn = 0; pdcp_p->next_pdcp_rx_sn = 0;
...@@ -1798,9 +1799,9 @@ rrc_pdcp_config_req ( ...@@ -1798,9 +1799,9 @@ rrc_pdcp_config_req (
} }
pdcp_p->first_missing_pdu = -1; 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); 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), PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_p),
rb_idP); rb_idP);
} }
......
...@@ -421,7 +421,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -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); AssertFatal (rab_id < maxDRB, "RB id is too high (%u/%d)!\n", rab_id, maxDRB);
if (rab_id != 0) { 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", "/ %d Bytes --->][PDCP][MOD %u][RB %u]\n",
ctxt_cpy.frame, ctxt_cpy.frame,
(ctxt_cpy.enb_flag) ? "eNB" : "UE", (ctxt_cpy.enb_flag) ? "eNB" : "UE",
...@@ -583,7 +583,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -583,7 +583,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
ctxt.enb_flag = ctxt_cpy.enb_flag; ctxt.enb_flag = ctxt_cpy.enb_flag;
#ifdef PDCP_DEBUG #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 #endif
if (ctxt_cpy.enb_flag) { if (ctxt_cpy.enb_flag) {
...@@ -682,13 +682,13 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -682,13 +682,13 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
} else { // enb_flag } else { // enb_flag
if (rab_id != 0) { if (rab_id != 0) {
if (rab_id == UE_IP_DEFAULT_RAB_ID) { 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); ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
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);
} else { } else {
rab_id = rab_id % maxDRB; 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); 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); 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);
...@@ -697,14 +697,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -697,14 +697,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
rab_id = pdcp_p->rb_id; rab_id = pdcp_p->rb_id;
#ifdef PDCP_DEBUG #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, ctxt.frame,
pdcp_read_header_g.inst, pdcp_read_header_g.inst,
len, len,
nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr), nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr),
pdcp_read_header_g.rb_id); 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, ctxt.frame,
pdcp_read_header_g.inst, pdcp_read_header_g.inst,
pdcp_read_header_g.rb_id, pdcp_read_header_g.rb_id,
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "assertions.h" #include "assertions.h"
#include "UTIL/LOG/vcd_signal_dumper.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 ( struct mac_data_ind mac_rlc_deserialize_tb (
...@@ -143,7 +143,7 @@ tbs_size_t mac_rlc_data_req( ...@@ -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); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_DATA_REQ,VCD_FUNCTION_IN);
#ifdef DEBUG_MAC_INTERFACE #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)), PROTOCOL_CTXT_ARGS((&ctxt)),
channel_idP, channel_idP,
RLC_MAX_LC, RLC_MAX_LC,
...@@ -196,7 +196,7 @@ tbs_size_t mac_rlc_data_req( ...@@ -196,7 +196,7 @@ tbs_size_t mac_rlc_data_req(
break; break;
case RLC_MODE_UM: case RLC_MODE_UM:
if (!enb_flagP) rlc_um_set_nb_bytes_requested_by_mac(&rlc_union_p->rlc.um,tb_sizeP); if (!enb_flagP) rlc_um_set_nb_bytes_requested_by_mac(&rlc_union_p->rlc.um,tb_sizeP);
data_request = rlc_um_mac_data_request(&ctxt, &rlc_union_p->rlc.um,enb_flagP); data_request = rlc_um_mac_data_request(&ctxt, &rlc_union_p->rlc.um,enb_flagP);
ret_tb_size = mac_rlc_serialize_tb(buffer_pP, data_request.data); ret_tb_size = mac_rlc_serialize_tb(buffer_pP, data_request.data);
break; break;
...@@ -390,7 +390,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind( ...@@ -390,7 +390,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
rlc_mode = rlc_union_p->mode; rlc_mode = rlc_union_p->mode;
} else { } else {
rlc_mode = RLC_MODE_NONE; 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); //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 { ...@@ -691,11 +691,16 @@ typedef struct UE_RRC_INST_s {
SystemInformationBlockType9_t *sib9[NB_CNX_UE]; SystemInformationBlockType9_t *sib9[NB_CNX_UE];
SystemInformationBlockType10_t *sib10[NB_CNX_UE]; SystemInformationBlockType10_t *sib10[NB_CNX_UE];
SystemInformationBlockType11_t *sib11[NB_CNX_UE]; SystemInformationBlockType11_t *sib11[NB_CNX_UE];
uint8_t *MIB;
#ifdef Rel14
//TTN - SIB18 //TTN - SIB18
SystemInformationBlockType18_r12_t *sib18[NB_CNX_UE]; SystemInformationBlockType18_r12_t *sib18[NB_CNX_UE];
SystemInformationBlockType19_r12_t *sib19[NB_CNX_UE]; SystemInformationBlockType19_r12_t *sib19[NB_CNX_UE];
uint8_t *MIB;
SBCCH_SL_BCH_MessageType_t mib_sl[NB_CNX_UE]; 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) #if defined(Rel10) || defined(Rel14)
uint8_t MBMS_flag; uint8_t MBMS_flag;
......
...@@ -183,8 +183,7 @@ void rrc_ue_process_sidelink_radioResourceConfig( ...@@ -183,8 +183,7 @@ void rrc_ue_process_sidelink_radioResourceConfig(
/** \brief Init control socket to listen to incoming packets from ProSe App /** \brief Init control socket to listen to incoming packets from ProSe App
* *
*/ */
void void rrc_control_socket_init(void);
rrc_control_socket_init();
// eNB/CH RRC Procedures // eNB/CH RRC Procedures
......
This diff is collapsed.
...@@ -639,6 +639,7 @@ static void get_options(void) { ...@@ -639,6 +639,7 @@ static void get_options(void) {
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
printf("get_options 0, UE_flag: %d", UE_flag); printf("get_options 0, UE_flag: %d", UE_flag);
...@@ -667,11 +668,13 @@ static void get_options(void) { ...@@ -667,11 +668,13 @@ static void get_options(void) {
} }
if (UE_flag > 0) { 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_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC;
paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_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_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
...@@ -687,67 +690,55 @@ static void get_options(void) { ...@@ -687,67 +690,55 @@ static void get_options(void) {
printf("Panos: get_options 9 \n"); printf("Panos: get_options 9 \n");
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp; if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
printf("Panos: get_options 10 \n"); printf("Panos: get_options 10 \n");
if ( cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr != NULL) { if ( (cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = debug_prach;
if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach; if ( (cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = no_L2_connect;
if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect; if ( (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = calib_prach_tx;
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
}
printf("Panos: get_options 11 \n"); printf("Panos: get_options 11 \n");
if (dumpframe > 0) mode = rx_dump_frame; if (dumpframe > 0) mode = rx_dump_frame;
if ( downlink_frequency[0][0] > 0) { if ( downlink_frequency[0][0] > 0) {
printf("Panos: get_options 8 \n"); printf("Downlink frequency set to %u\n", downlink_frequency[0][0]);
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
downlink_frequency[CC_id][1] = downlink_frequency[0][0]; frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
downlink_frequency[CC_id][2] = downlink_frequency[0][0]; }
downlink_frequency[CC_id][3] = downlink_frequency[0][0]; UE_scan=0;
printf("Downlink for CC_id %d frequency set to %u\n", CC_id, downlink_frequency[CC_id][0]); }
}
UE_scan=0;
}
printf("Panos: get_options 15 \n");
if (tddflag > 0) { if (tddflag > 0) {
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
frame_parms[CC_id]->frame_type = TDD; 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 ( 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 ( 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 ( 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);
}
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;
}
} }
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 ( n_rb_dl > 100 ) {
n_rb_dl = 100;
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",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 ( 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;
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++) { for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++) {
tx_max_power[CC_id]=tx_max_power[0]; tx_max_power[CC_id]=tx_max_power[0];
rx_gain[0][CC_id] = rx_gain[0][0]; rx_gain[0][CC_id] = rx_gain[0][0];
tx_gain[0][CC_id] = tx_gain[0][0]; tx_gain[0][CC_id] = tx_gain[0][0];
} }
printf("Panos: get_options 6 \n");
} /* UE_flag > 0 */ } /* UE_flag > 0 */
#if T_TRACER #if T_TRACER
paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ; paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ;
...@@ -767,7 +758,7 @@ static void get_options(void) { ...@@ -767,7 +758,7 @@ static void get_options(void) {
// Here the configuration file is the XER encoded UE capabilities // Here the configuration file is the XER encoded UE capabilities
// Read it in and store in asn1c data structures // Read it in and store in asn1c data structures
strcpy(uecap_xer,CONFIG_GETCONFFILE); strcpy(uecap_xer,CONFIG_GETCONFFILE);
uecap_xer_in=1; uecap_xer_in=0;
printf("Panos: get_options 7 \n"); printf("Panos: get_options 7 \n");
} /* UE with config file */ } /* UE with config file */
} }
...@@ -976,10 +967,16 @@ int main( int argc, char **argv ) ...@@ -976,10 +967,16 @@ int main( int argc, char **argv )
get_options (); get_options ();
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
if (UE_flag == 0) {
fprintf(stderr,"Getting configuration failed\n"); fprintf(stderr,"Getting configuration failed\n");
exit(-1); exit(-1);
}
else {
printf("Setting nfapi mode to UE_STUB_OFFNET\n");
nfapi_mode = 4;
}
} }
#if T_TRACER #if T_TRACER
T_init(T_port, 1-T_nowait, T_dont_fork); T_init(T_port, 1-T_nowait, T_dont_fork);
...@@ -993,10 +990,10 @@ int main( int argc, char **argv ) ...@@ -993,10 +990,10 @@ int main( int argc, char **argv )
if (UE_flag==1) { if (UE_flag==1) {
printf("configuring for UE\n"); printf("configuring for UE\n");
set_comp_log(HW, LOG_DEBUG, LOG_HIGH, 1); set_comp_log(HW, LOG_INFO, LOG_HIGH, 1);
set_comp_log(PHY, LOG_DEBUG, LOG_HIGH, 1); set_comp_log(PHY, LOG_INFO, LOG_HIGH, 1);
set_comp_log(MAC, LOG_INFO, LOG_HIGH, 1); set_comp_log(MAC, LOG_TRACE, LOG_HIGH, 1);
set_comp_log(RLC, LOG_INFO, LOG_HIGH | FLAG_THREAD, 1); set_comp_log(RLC, LOG_TRACE, LOG_HIGH | FLAG_THREAD, 1);
set_comp_log(PDCP, LOG_INFO, LOG_HIGH, 1); set_comp_log(PDCP, LOG_INFO, LOG_HIGH, 1);
set_comp_log(OTG, LOG_INFO, LOG_HIGH, 1); set_comp_log(OTG, LOG_INFO, LOG_HIGH, 1);
set_comp_log(RRC, LOG_INFO, LOG_HIGH, 1); set_comp_log(RRC, LOG_INFO, LOG_HIGH, 1);
...@@ -1223,7 +1220,7 @@ int main( int argc, char **argv ) ...@@ -1223,7 +1220,7 @@ int main( int argc, char **argv )
printf("cannot create ITTI tasks\n"); printf("cannot create ITTI tasks\n");
exit(-1); // need a softer mode exit(-1); // need a softer mode
} }
UE_config_stub_pnf(); // UE_config_stub_pnf();
printf("ITTI tasks created\n"); printf("ITTI tasks created\n");
} }
else { else {
...@@ -1331,14 +1328,17 @@ int main( int argc, char **argv ) ...@@ -1331,14 +1328,17 @@ int main( int argc, char **argv )
case 3: case 3:
nfapi_mode_str = "UE_STUB_PNF"; nfapi_mode_str = "UE_STUB_PNF";
break; break;
case 4:
nfapi_mode_str = "UE_STUB_OFFNET";
break;
default: default:
nfapi_mode_str = "<UNKNOWN NFAPI MODE>"; nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
break; break;
} }
printf("NFAPI MODE:%s\n", nfapi_mode_str); 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?"); wait_nfapi_init("main?");
printf("START MAIN THREADS\n"); printf("START MAIN THREADS\n");
......
...@@ -607,9 +607,12 @@ static void get_options(void) { ...@@ -607,9 +607,12 @@ static void get_options(void) {
if (UE_flag > 0) { if (UE_flag > 0) {
uint8_t n_rb_dl;
nfapi_mode=0;
paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC;
paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC; paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC;
set_default_frame_parms(frame_parms);
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
...@@ -623,19 +626,17 @@ static void get_options(void) { ...@@ -623,19 +626,17 @@ static void get_options(void) {
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue; if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue;
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med; if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med;
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp; if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
if ( *(cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].uptr) > 0) mode = debug_prach; if ( (cmdline_uemodeparams[CMDLINE_DEBUGUEPRACH_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = debug_prach;
if ( *(cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].uptr) > 0) mode = no_L2_connect; if ( (cmdline_uemodeparams[CMDLINE_NOL2CONNECT_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = no_L2_connect;
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx; if ( (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = calib_prach_tx;
if (dumpframe > 0) mode = rx_dump_frame; if (dumpframe > 0) mode = rx_dump_frame;
if ( downlink_frequency[0][0] > 0) { if ( downlink_frequency[0][0] > 0) {
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) { printf("Downlink frequency set to %u\n", downlink_frequency[0][0]);
downlink_frequency[CC_id][1] = downlink_frequency[0][0]; for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
downlink_frequency[CC_id][2] = downlink_frequency[0][0]; frame_parms[CC_id]->dl_CarrierFreq = 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]); UE_scan=0;
}
UE_scan=0;
} }
if (tddflag > 0) { if (tddflag > 0) {
...@@ -643,29 +644,29 @@ static void get_options(void) { ...@@ -643,29 +644,29 @@ static void get_options(void) {
frame_parms[CC_id]->frame_type = TDD; frame_parms[CC_id]->frame_type = TDD;
} }
if (frame_parms[0]->N_RB_DL !=0) { if (n_rb_dl !=0) {
if ( frame_parms[0]->N_RB_DL < 6 ) { printf("NB_RB set to %d\n",n_rb_dl);
frame_parms[0]->N_RB_DL = 6; if ( n_rb_dl < 6 ) {
printf ( "%i: Invalid number of ressource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL); 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; if ( n_rb_dl > 100 ) {
printf ( "%i: Invalid number of ressource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL); 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; if ( n_rb_dl > 50 && n_rb_dl < 100 ) {
printf ( "%i: Invalid number of ressource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL); 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; if ( n_rb_dl > 25 && n_rb_dl < 50 ) {
printf ( "%i: Invalid number of ressource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL); 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; UE_scan = 0;
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; 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_DL=n_rb_dl;
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL; frame_parms[CC_id]->N_RB_UL=n_rb_dl;
} }
} }
...@@ -693,7 +694,7 @@ static void get_options(void) { ...@@ -693,7 +694,7 @@ static void get_options(void) {
// Here the configuration file is the XER encoded UE capabilities // Here the configuration file is the XER encoded UE capabilities
// Read it in and store in asn1c data structures // Read it in and store in asn1c data structures
strcpy(uecap_xer,CONFIG_GETCONFFILE); strcpy(uecap_xer,CONFIG_GETCONFFILE);
uecap_xer_in=1; // uecap_xer_in=1;
} /* UE with config file */ } /* UE with config file */
} }
...@@ -938,13 +939,13 @@ int main( int argc, char **argv ) ...@@ -938,13 +939,13 @@ int main( int argc, char **argv )
// set default parameters // set default parameters
if (UE_flag == 1) set_default_frame_parms(frame_parms); //if (UE_flag == 1) set_default_frame_parms(frame_parms);
logInit(); logInit();
printf("Reading in command-line options\n"); printf("Reading in command-line options\n");
get_options (); get_options ();
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { if (CONFIG_ISFLAGSET(CONFIG_ABORT) && UE_flag == 0) {
fprintf(stderr,"Getting configuration failed\n"); fprintf(stderr,"Getting configuration failed\n");
exit(-1); exit(-1);
} }
...@@ -1055,7 +1056,6 @@ int main( int argc, char **argv ) ...@@ -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++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
...@@ -1115,11 +1115,10 @@ int main( int argc, char **argv ) ...@@ -1115,11 +1115,10 @@ int main( int argc, char **argv )
else if (frame_parms[CC_id]->N_RB_DL == 25) else if (frame_parms[CC_id]->N_RB_DL == 25)
UE[CC_id]->N_TA_offset = 624/4; UE[CC_id]->N_TA_offset = 624/4;
} }
init_openair0();
} }
} }
printf("Runtime table\n");
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx); fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
...@@ -1168,10 +1167,6 @@ int main( int argc, char **argv ) ...@@ -1168,10 +1167,6 @@ int main( int argc, char **argv )
#if defined(ENABLE_ITTI) #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)|| if ((UE_flag == 1)||
(RC.nb_inst > 0)) { (RC.nb_inst > 0)) {
...@@ -1189,14 +1184,6 @@ int main( int argc, char **argv ) ...@@ -1189,14 +1184,6 @@ int main( int argc, char **argv )
} }
#endif #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); mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_cond_init(&sync_cond,NULL); pthread_cond_init(&sync_cond,NULL);
...@@ -1298,6 +1285,12 @@ int main( int argc, char **argv ) ...@@ -1298,6 +1285,12 @@ int main( int argc, char **argv )
if (UE_flag == 1) { if (UE_flag == 1) {
int eMBMS_active = 0; int eMBMS_active = 0;
init_UE(1,eMBMS_active,uecap_xer_in); 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; number_of_cards = 1;
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
...@@ -1315,10 +1308,8 @@ int main( int argc, char **argv ) ...@@ -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); // 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(); wait_eNBs();
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
if (RC.nb_RU >0) { if (RC.nb_RU >0) {
printf("Initializing RU threads\n"); printf("Initializing RU threads\n");
init_RU(rf_config_file); init_RU(rf_config_file);
......
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ {"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-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}, \ {"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}, \
} }
......
This diff is collapsed.
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