Commit fbe1958e authored by gauthier's avatar gauthier

Merge branch 'develop' into bugfix-48-L1L2signaling

Conflicts:
	openair1/SCHED/phy_procedures_lte_eNb.c
	targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
parents 7c1fb7fb 4becccc1
...@@ -139,7 +139,7 @@ Obj.# Case# Test# Description ...@@ -139,7 +139,7 @@ Obj.# Case# Test# Description
01 62 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE 01 62 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
01 63 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE 01 63 lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
01 58 lte-softmodem-noS1 tests 01 64 lte-softmodem-noS1 tests
02 Functional test case 02 Functional test case
......
...@@ -181,7 +181,8 @@ class core: ...@@ -181,7 +181,8 @@ class core:
rsp2 = self.prompt2 rsp2 = self.prompt2
self.wait_quiet() self.wait_quiet()
if sudo == True: if sudo == True:
command = 'echo \'' + self.password + '\' | sudo -S -E ' + command #command = 'echo \'' + self.password + '\' | sudo -S -E ' + command
command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' '
if self.send_cr: if self.send_cr:
log.stats['cmd'] += 1 log.stats['cmd'] += 1
self.oai.sendline(command) self.oai.sendline(command)
......
This diff is collapsed.
n=oarf_get_num_detected_cards;
for i=n-1:0
oarf_stop(i);
end
#!/bin/bash
################################################################################
# OpenAirInterface
# Copyright(c) 1999 - 2015 Eurecom
#
# OpenAirInterface is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# OpenAirInterface is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenAirInterface.The full GNU General Public License is
# included in this distribution in the file called "COPYING". If not,
# see <http://www.gnu.org/licenses/>.
#
# Contact Information
# OpenAirInterface Admin: openair_admin@eurecom.fr
# OpenAirInterface Tech : openair_tech@eurecom.fr
# OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
#
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
#
################################################################################
# file init_nas_nos1
# brief loads the nasmesh module and sets up the radio bearers (used to provide ip interface without S1 interface)
# author Florian Kaltenberger
#
#######################################
load_module()
{
mod_name=${1##*/}
mod_name=${mod_name%.*}
if awk "/$mod_name/ {found=1 ;exit} END {if (found!=1) exit 1}" /proc/modules
then
echo "module $mod_name already loaded: I remove it first"
sudo rmmod $mod_name
fi
echo loading $mod_name
sudo insmod $1
}
function main()
{
PCI=`lspci -m | grep Xilinx`
if [ -z "$PCI" ]; then
echo "No card found. Stopping!"
return
fi
## This part corrects the wrong configuration of the endpoint done by the bios in some machines
echo "$PCI" | while read config_reg; do
SLOT_NUMBER=`echo $config_reg | awk -F\" '{print $1}'`
sudo setpci -s $SLOT_NUMBER 60.b=10
done
load_module $OPENAIR_DIR/targets/bin/openair_rf.ko
sleep 1
if [ ! -e /dev/openair0 ]; then
sudo mknod /dev/openair0 c 127 0
sudo chmod a+rw /dev/openair0
fi
DEVICE=`echo $PCI | awk -F\" '{print $(NF-1)}' | awk '{print $2}'`
DEVICE_SWID=${DEVICE:2:2}
if [ $DEVICE_SWID == '0a' ]; then
echo "Using firware version 10"
$OPENAIR_DIR/targets/bin/updatefw -s 0x43fffff0 -b -f $OPENAIR_TARGETS/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10
else
echo 'No corresponding firmware found'
return
fi
}
main "$@"
...@@ -5,7 +5,8 @@ export OPENAIR1_DIR=$OPENAIR_HOME/openair1 ...@@ -5,7 +5,8 @@ export OPENAIR1_DIR=$OPENAIR_HOME/openair1
export OPENAIR2_DIR=$OPENAIR_HOME/openair2 export OPENAIR2_DIR=$OPENAIR_HOME/openair2
export OPENAIR3_DIR=$OPENAIR_HOME/openair3 export OPENAIR3_DIR=$OPENAIR_HOME/openair3
export OPENAIR_TARGETS=$OPENAIR_HOME/targets export OPENAIR_TARGETS=$OPENAIR_HOME/targets
export OPENAIRITS_DIR=$OPENAIR_HOME/openairITS
export PATH=$PATH:$OPENAIR_TARGETS/bin
alias oai='cd $OPENAIR_HOME' alias oai='cd $OPENAIR_HOME'
alias oai0='cd $OPENAIR0_DIR' alias oai0='cd $OPENAIR0_DIR'
......
...@@ -1128,8 +1128,12 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -1128,8 +1128,12 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch[0]->harq_ids[subframe] = harq_pid; dlsch[0]->harq_ids[subframe] = harq_pid;
if (dlsch0_harq->round == 0) if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
}
break; break;
...@@ -1263,6 +1267,9 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -1263,6 +1267,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if (dlsch0_harq->round == 0) { if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
// MCS and TBS don't change across HARQ rounds // MCS and TBS don't change across HARQ rounds
...@@ -1631,10 +1638,16 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -1631,10 +1638,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// reset HARQ process if this is the first transmission // reset HARQ process if this is the first transmission
if (dlsch0_harq->round == 0) { if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
} }
if (dlsch1_harq->round == 0) { if (dlsch1_harq->round == 0) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
dlsch1_harq->status = ACTIVE; dlsch1_harq->status = ACTIVE;
} }
...@@ -2012,10 +2025,16 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -2012,10 +2025,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// reset HARQ process if this is the first transmission // reset HARQ process if this is the first transmission
if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) { if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
} }
if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) { if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
dlsch1_harq->status = ACTIVE; dlsch1_harq->status = ACTIVE;
} }
...@@ -2157,16 +2176,23 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -2157,16 +2176,23 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// check if either TB is disabled (see 36-213 V8.6 p. 26) // check if either TB is disabled (see 36-213 V8.6 p. 26)
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) {
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
dlsch0_harq->status = DISABLED; dlsch0_harq->status = DISABLED;
}
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) {
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
dlsch1_harq->status = DISABLED; dlsch1_harq->status = DISABLED;
}
dlsch0_harq->Nl = 1; dlsch0_harq->Nl = 1;
if (dlsch0_harq->round == 0) { if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
} }
...@@ -2331,11 +2357,17 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -2331,11 +2357,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if ((dlsch0_harq->round == 0) && (dlsch0->active == 1) ) { if ((dlsch0_harq->round == 0) && (dlsch0->active == 1) ) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0_harq->mcs = mcs1; dlsch0_harq->mcs = mcs1;
} }
if ((dlsch1_harq->round == 0) && (dlsch1->active == 1) ) { if ((dlsch1_harq->round == 0) && (dlsch1->active == 1) ) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
dlsch1_harq->status = ACTIVE; dlsch1_harq->status = ACTIVE;
dlsch1_harq->mcs = mcs2; dlsch1_harq->mcs = mcs2;
} }
...@@ -2499,6 +2531,9 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -2499,6 +2531,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if (dlsch0_harq->round == 0) { if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
} }
...@@ -2628,6 +2663,9 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -2628,6 +2663,9 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// dlsch0_harq->Ndi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi; // dlsch0_harq->Ndi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi;
if (dlsch0_harq->round == 0) { if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid); // printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
} }
......
...@@ -258,6 +258,13 @@ typedef struct { ...@@ -258,6 +258,13 @@ typedef struct {
uint8_t error_threshold; uint8_t error_threshold;
/// Pointers to 8 HARQ processes for the DLSCH /// Pointers to 8 HARQ processes for the DLSCH
LTE_DL_eNB_HARQ_t *harq_processes[8]; LTE_DL_eNB_HARQ_t *harq_processes[8];
/// circular list of free harq PIDs (the oldest come first)
/// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE)
int harq_pid_freelist[10];
/// the head position of the free list (if list is free then head=tail)
int head_freelist;
/// the tail position of the free list
int tail_freelist;
/// Number of soft channel bits /// Number of soft channel bits
uint32_t G; uint32_t G;
/// Codebook index for this dlsch (0,1,2,3) /// Codebook index for this dlsch (0,1,2,3)
......
...@@ -153,6 +153,9 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ ...@@ -153,6 +153,9 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
for (i=0; i<10; i++) for (i=0; i<10; i++)
dlsch->harq_ids[i] = Mdlharq; dlsch->harq_ids[i] = Mdlharq;
dlsch->head_freelist = 0;
dlsch->tail_freelist = 0;
for (i=0; i<Mdlharq; i++) { for (i=0; i<Mdlharq; i++) {
dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t)); dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n", LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
...@@ -193,6 +196,8 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ ...@@ -193,6 +196,8 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
msg("Can't get harq_p %d\n",i); msg("Can't get harq_p %d\n",i);
exit_flag=3; exit_flag=3;
} }
put_harq_pid_in_freelist(dlsch, i);
} }
if (exit_flag==0) { if (exit_flag==0) {
......
...@@ -400,6 +400,8 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui ...@@ -400,6 +400,8 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1); uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB); int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
......
...@@ -135,6 +135,30 @@ uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_su ...@@ -135,6 +135,30 @@ uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_su
return(0); return(0);
} }
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
{
DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->tail_freelist] = harq_pid;
DLSCH_ptr->tail_freelist = (DLSCH_ptr->tail_freelist + 1) % 10;
}
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
{
if (DLSCH_ptr->head_freelist == DLSCH_ptr->tail_freelist) {
LOG_E(PHY, "%s:%d: you cannot read this!\n", __FILE__, __LINE__);
abort();
}
/* basic check, in case several threads deal with the free list at the same time
* in normal situations it should not happen, that's also why we don't use any
* locking mechanism to protect the free list
* to be refined in case things don't work properly
*/
if (harq_pid != DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]) {
LOG_E(PHY, "%s:%d: critical error, get in touch with the authors\n", __FILE__, __LINE__);
abort();
}
DLSCH_ptr->head_freelist = (DLSCH_ptr->head_freelist + 1) % 10;
}
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
{ {
uint8_t i; uint8_t i;
...@@ -177,6 +201,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB) ...@@ -177,6 +201,7 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction_flag) int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction_flag)
{ {
uint8_t i; uint8_t i;
int j;
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) { if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) {
...@@ -195,6 +220,13 @@ int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction ...@@ -195,6 +220,13 @@ int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction
//phy_vars_eNB->eNB_UE_stats[i].crnti = 0; //phy_vars_eNB->eNB_UE_stats[i].crnti = 0;
memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats)); memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats));
// mac_exit_wrapper("Removing UE"); // mac_exit_wrapper("Removing UE");
/* clear the harq pid freelist */
phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0;
phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0;
for (j = 0; j < 8; j++)
put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j);
return(i); return(i);
} }
} }
...@@ -223,14 +255,12 @@ int8_t find_next_ue_index(PHY_VARS_eNB *phy_vars_eNB) ...@@ -223,14 +255,12 @@ int8_t find_next_ue_index(PHY_VARS_eNB *phy_vars_eNB)
int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t ul_flag) int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16_t rnti, const int frame, const uint8_t subframe,uint8_t *harq_pid,uint8_t *round,const uint8_t ul_flag)
{ {
LTE_eNB_DLSCH_t *DLSCH_ptr; LTE_eNB_DLSCH_t *DLSCH_ptr;
LTE_eNB_ULSCH_t *ULSCH_ptr; LTE_eNB_ULSCH_t *ULSCH_ptr;
uint8_t ulsch_subframe,ulsch_frame; uint8_t ulsch_subframe,ulsch_frame;
uint8_t i; uint8_t i;
int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]); int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
int sf1=(10*frame)+subframe,sf2,sfdiff,sfdiff_max=7; int sf1=(10*frame)+subframe,sf2,sfdiff,sfdiff_max=7;
int first_proc_found=0;
if (UE_id==-1) { if (UE_id==-1) {
LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id); LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
...@@ -246,18 +276,7 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -246,18 +276,7 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
for (i=0; i<DLSCH_ptr->Mdlharq; i++) { for (i=0; i<DLSCH_ptr->Mdlharq; i++) {
if (DLSCH_ptr->harq_processes[i]!=NULL) { if (DLSCH_ptr->harq_processes[i]!=NULL) {
if (DLSCH_ptr->harq_processes[i]->status != ACTIVE) { if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
// store first inactive process
if (first_proc_found == 0) {
first_proc_found = 1;
*harq_pid = i;
*round = 0;
LOG_D(PHY,"process %d is first free process\n",i);
}
else {
LOG_D(PHY,"process %d is free\n",i);
}
} else {
sf2 = (DLSCH_ptr->harq_processes[i]->frame*10) + DLSCH_ptr->harq_processes[i]->subframe; sf2 = (DLSCH_ptr->harq_processes[i]->frame*10) + DLSCH_ptr->harq_processes[i]->subframe;
if (sf2<=sf1) if (sf2<=sf1)
sfdiff = sf1-sf2; sfdiff = sf1-sf2;
...@@ -269,7 +288,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -269,7 +288,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
sfdiff_max = sfdiff; sfdiff_max = sfdiff;
*harq_pid = i; *harq_pid = i;
*round = DLSCH_ptr->harq_processes[i]->round; *round = DLSCH_ptr->harq_processes[i]->round;
first_proc_found = 1;
} }
} }
} else { // a process is not defined } else { // a process is not defined
...@@ -277,6 +295,14 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -277,6 +295,14 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
return(-1); return(-1);
} }
} }
/* if no active harq pid, get the oldest in the freelist, if any */
if (*harq_pid == 255 && DLSCH_ptr->head_freelist != DLSCH_ptr->tail_freelist) {
*harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
*round = 0;
LOG_D(PHY,"process %d is first free process\n", *harq_pid);
}
LOG_D(PHY,"get_ue_active_harq_pid DL => Frame %d, Subframe %d : harq_pid %d\n", LOG_D(PHY,"get_ue_active_harq_pid DL => Frame %d, Subframe %d : harq_pid %d\n",
frame,subframe,*harq_pid); frame,subframe,*harq_pid);
} else { // This is a UL request } else { // This is a UL request
...@@ -295,7 +321,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16 ...@@ -295,7 +321,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
return(0); return(0);
} }
int16_t get_target_pusch_rx_power(const module_id_t module_idP, const uint8_t CC_id) int16_t get_target_pusch_rx_power(const module_id_t module_idP, const uint8_t CC_id)
{ {
//return PHY_vars_eNB_g[module_idP][CC_id]->PHY_measurements_eNB[0].n0_power_tot_dBm; //return PHY_vars_eNB_g[module_idP][CC_id]->PHY_measurements_eNB[0].n0_power_tot_dBm;
...@@ -2745,6 +2770,7 @@ void process_HARQ_feedback(uint8_t UE_id, ...@@ -2745,6 +2770,7 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch_harq_proc->round = 0; dlsch_harq_proc->round = 0;
ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++; ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++;
dlsch_harq_proc->status = SCH_IDLE; dlsch_harq_proc->status = SCH_IDLE;
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq; dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
} }
} else { } else {
...@@ -2757,6 +2783,7 @@ void process_HARQ_feedback(uint8_t UE_id, ...@@ -2757,6 +2783,7 @@ void process_HARQ_feedback(uint8_t UE_id,
// Received ACK so set round to 0 and set dlsch_harq_pid IDLE // Received ACK so set round to 0 and set dlsch_harq_pid IDLE
dlsch_harq_proc->round = 0; dlsch_harq_proc->round = 0;
dlsch_harq_proc->status = SCH_IDLE; dlsch_harq_proc->status = SCH_IDLE;
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq; dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
ue_stats->total_TBS = ue_stats->total_TBS + ue_stats->total_TBS = ue_stats->total_TBS +
...@@ -3871,6 +3898,9 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_ ...@@ -3871,6 +3898,9 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
phy_vars_eNB->eNB_UE_stats[i].sr_received++; phy_vars_eNB->eNB_UE_stats[i].sr_received++;
if (phy_vars_eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4 if (phy_vars_eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
/* is this test necessary? */
if (phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status != SCH_IDLE)
put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], 0);
phy_vars_eNB->first_sr[i] = 0; phy_vars_eNB->first_sr[i] = 0;
phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->round=0; phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->round=0;
phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status=SCH_IDLE; phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status=SCH_IDLE;
......
...@@ -60,6 +60,11 @@ typedef enum { ...@@ -60,6 +60,11 @@ typedef enum {
max_gain=0,med_gain,byp_gain max_gain=0,med_gain,byp_gain
} rx_gain_t; } rx_gain_t;
typedef enum {
duplex_mode_TDD=1,duplex_mode_FDD=0
} duplex_mode_t;
/** @addtogroup _PHY_RF_INTERFACE_ /** @addtogroup _PHY_RF_INTERFACE_
* @{ * @{
*/ */
...@@ -76,6 +81,8 @@ typedef struct { ...@@ -76,6 +81,8 @@ typedef struct {
int Mod_id; int Mod_id;
// device log level // device log level
int log_level; int log_level;
//! duplexing mode
duplex_mode_t duplex_mode;
//! number of downlink resource blocks //! number of downlink resource blocks
int num_rb_dl; int num_rb_dl;
//! number of samples per frame //! number of samples per frame
......
...@@ -316,7 +316,9 @@ typedef struct { ...@@ -316,7 +316,9 @@ typedef struct {
// //
// In TDD mode, there are two ways to control the RX/TX switch: // In TDD mode, there are two ways to control the RX/TX switch:
// 1. using the LSB from the TX data (TXRXSWITCH_LSB) // 1. using the LSB from the TX data (TXRXSWITCH_LSB)
// only the LSB from RF chain set in the ACTIVE_RF register controls the switch on all the chains
// 2. using FPGA logic, based on switch_offset[0..3] // 2. using FPGA logic, based on switch_offset[0..3]
// this mode is not tested well and should be used with care
#define DUPLEXMODE_MASK (1<<0) #define DUPLEXMODE_MASK (1<<0)
#define DUPLEXMODE_FDD 0 #define DUPLEXMODE_FDD 0
#define DUPLEXMODE_TDD (1<<0) #define DUPLEXMODE_TDD (1<<0)
...@@ -330,6 +332,11 @@ typedef struct { ...@@ -330,6 +332,11 @@ typedef struct {
#define SWITCHSTATE_1 (1<<3) #define SWITCHSTATE_1 (1<<3)
#define TEST_ADACLOOP_MASK (1<<4) #define TEST_ADACLOOP_MASK (1<<4)
#define TEST_ADACLOOP_EN (1<<4) #define TEST_ADACLOOP_EN (1<<4)
#define RF_ACTIVE_MASK (15<<5)
#define RF_ACTIVE_1 (1<<5)
#define RF_ACTIVE_2 (2<<5)
#define RF_ACTIVE_3 (4<<5)
#define RF_ACTIVE_4 (8<<5)
typedef enum { typedef enum {
BW5, BW5,
......
...@@ -296,6 +296,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -296,6 +296,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
int ant, card; int ant, card;
int resampling_factor=2; int resampling_factor=2;
int rx_filter=RXLPF25, tx_filter=TXLPF25; int rx_filter=RXLPF25, tx_filter=TXLPF25;
int ACTIVE_RF=0;
exmimo_config_t *p_exmimo_config; exmimo_config_t *p_exmimo_config;
exmimo_id_t *p_exmimo_id; exmimo_id_t *p_exmimo_id;
...@@ -315,8 +316,6 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -315,8 +316,6 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
else else
p_exmimo_config->framing.eNB_flag = !UE_flag; p_exmimo_config->framing.eNB_flag = !UE_flag;
p_exmimo_config->framing.tdd_config = DUPLEXMODE_FDD + TXRXSWITCH_LSB;
if (openair0_num_detected_cards==1) if (openair0_num_detected_cards==1)
p_exmimo_config->framing.multicard_syncmode=SYNCMODE_FREE; p_exmimo_config->framing.multicard_syncmode=SYNCMODE_FREE;
else if (card==0) else if (card==0)
...@@ -355,6 +354,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -355,6 +354,7 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
for (ant=0; ant<4; ant++) { for (ant=0; ant<4; ant++) {
if (openair0_cfg[card].rx_freq[ant] || openair0_cfg[card].tx_freq[ant]) { if (openair0_cfg[card].rx_freq[ant] || openair0_cfg[card].tx_freq[ant]) {
ACTIVE_RF += (1<<ant)<<5;
p_exmimo_config->rf.rf_mode[ant] = RF_MODE_BASE; p_exmimo_config->rf.rf_mode[ant] = RF_MODE_BASE;
p_exmimo_config->rf.do_autocal[ant] = 1;//openair0_cfg[card].autocal[ant]; p_exmimo_config->rf.do_autocal[ant] = 1;//openair0_cfg[card].autocal[ant];
printf("card %d, antenna %d, autocal %d\n",card,ant,openair0_cfg[card].autocal[ant]); printf("card %d, antenna %d, autocal %d\n",card,ant,openair0_cfg[card].autocal[ant]);
...@@ -408,6 +408,15 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag) ...@@ -408,6 +408,15 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
} }
} }
if (openair0_cfg[card].duplex_mode==duplex_mode_FDD) {
p_exmimo_config->framing.tdd_config = DUPLEXMODE_FDD;
printf("!!!!!setting FDD (tdd_config=%d)\n",p_exmimo_config->framing.tdd_config);
}
else {
p_exmimo_config->framing.tdd_config = DUPLEXMODE_TDD + TXRXSWITCH_LSB + ACTIVE_RF;
printf("!!!!!setting TDD (tdd_config=%d)\n",p_exmimo_config->framing.tdd_config);
}
ret = ioctl(openair0_fd, openair_DUMP_CONFIG, card); ret = ioctl(openair0_fd, openair_DUMP_CONFIG, card);
if (ret!=0) if (ret!=0)
......
...@@ -479,13 +479,11 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ ...@@ -479,13 +479,11 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
} }
} }
for(i=0;i<s->usrp->get_rx_num_channels();i++) { for(i=0;i<s->usrp->get_rx_num_channels();i++) {
if (i<openair0_cfg[0].rx_num_channels) { if (i<openair0_cfg[0].rx_num_channels) {
s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i); s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i);
s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
printf("Setting rx freq/gain on channel %lu/%lu\n",i,s->usrp->get_rx_num_channels()); printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6);
s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i); s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i);
set_rx_gain_offset(&openair0_cfg[0],i); set_rx_gain_offset(&openair0_cfg[0],i);
...@@ -506,7 +504,7 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ ...@@ -506,7 +504,7 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
if (i<openair0_cfg[0].tx_num_channels) { if (i<openair0_cfg[0].tx_num_channels) {
s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i); s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i);
s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
printf("Setting tx freq/gain on channel %lu/%lu\n",i,s->usrp->get_tx_num_channels()); printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6);
s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i); s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i);
s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i); s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i);
} }
......
...@@ -17,7 +17,7 @@ eNBs = ...@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "92"; mobile_network_code = "93";
////////// Physical parameters: ////////// Physical parameters:
...@@ -131,7 +131,7 @@ eNBs = ...@@ -131,7 +131,7 @@ eNBs =
}; };
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.13.11"; mme_ip_address = ( { ipv4 = "192.168.12.70";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -141,10 +141,10 @@ eNBs = ...@@ -141,10 +141,10 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.212/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0"; ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.212/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
...@@ -17,7 +17,7 @@ eNBs = ...@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "92"; mobile_network_code = "93";
////////// Physical parameters: ////////// Physical parameters:
...@@ -31,7 +31,7 @@ eNBs = ...@@ -31,7 +31,7 @@ eNBs =
downlink_frequency = 2680000000L; downlink_frequency = 2680000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
N_RB_DL = 50; N_RB_DL = 25;
Nid_cell_mbsfn = 0; Nid_cell_mbsfn = 0;
nb_antennas_tx = 1; nb_antennas_tx = 1;
nb_antennas_rx = 1; nb_antennas_rx = 1;
...@@ -131,7 +131,7 @@ eNBs = ...@@ -131,7 +131,7 @@ eNBs =
}; };
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "10.0.1.1"; mme_ip_address = ( { ipv4 = "192.168.12.171";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -140,11 +140,11 @@ eNBs = ...@@ -140,11 +140,11 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; ENB_INTERFACE_NAME_FOR_S1_MME = "eth2";
ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.1.229/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.80/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth3"; ENB_INTERFACE_NAME_FOR_S1U = "eth2";
ENB_IPV4_ADDRESS_FOR_S1U = "10.0.1.229/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.80/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
...@@ -36,7 +36,7 @@ eNBs = ...@@ -36,7 +36,7 @@ eNBs =
nb_antennas_tx = 1; nb_antennas_tx = 1;
nb_antennas_rx = 1; nb_antennas_rx = 1;
tx_gain = 90; tx_gain = 90;
rx_gain = 130; rx_gain = 132;
prach_root = 0; prach_root = 0;
prach_config_index = 0; prach_config_index = 0;
prach_high_speed = "DISABLE"; prach_high_speed = "DISABLE";
......
...@@ -36,7 +36,7 @@ eNBs = ...@@ -36,7 +36,7 @@ eNBs =
nb_antennas_tx = 1; nb_antennas_tx = 1;
nb_antennas_rx = 1; nb_antennas_rx = 1;
tx_gain = 90; tx_gain = 90;
rx_gain = 120; rx_gain = 132;
prach_root = 0; prach_root = 0;
prach_config_index = 0; prach_config_index = 0;
prach_high_speed = "DISABLE"; prach_high_speed = "DISABLE";
......
...@@ -35,7 +35,7 @@ eNBs = ...@@ -35,7 +35,7 @@ eNBs =
nb_antennas_tx = 1; nb_antennas_tx = 1;
nb_antennas_rx = 1; nb_antennas_rx = 1;
tx_gain = 90; tx_gain = 90;
rx_gain = 119; rx_gain = 132;
prach_root = 0; prach_root = 0;
prach_config_index = 0; prach_config_index = 0;
prach_high_speed = "DISABLE"; prach_high_speed = "DISABLE";
......
...@@ -36,7 +36,7 @@ eNBs = ...@@ -36,7 +36,7 @@ eNBs =
nb_antennas_tx = 2; nb_antennas_tx = 2;
nb_antennas_rx = 2; nb_antennas_rx = 2;
tx_gain = 90; tx_gain = 90;
rx_gain = 115; rx_gain = 132;
prach_root = 0; prach_root = 0;
prach_config_index = 0; prach_config_index = 0;
prach_high_speed = "DISABLE"; prach_high_speed = "DISABLE";
...@@ -132,7 +132,7 @@ eNBs = ...@@ -132,7 +132,7 @@ eNBs =
}; };
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.13.11"; mme_ip_address = ( { ipv4 = "192.168.12.11";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -142,10 +142,10 @@ eNBs = ...@@ -142,10 +142,10 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.213/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0"; ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.213/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
...@@ -289,6 +289,8 @@ double bw = 10.0e6; ...@@ -289,6 +289,8 @@ double bw = 10.0e6;
static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/; static int tx_max_power[MAX_NUM_CCs]; /* = {0,0}*/;
int chain_offset=0;
#ifndef EXMIMO #ifndef EXMIMO
char ref[128] = "internal"; char ref[128] = "internal";
char channels[128] = "0"; char channels[128] = "0";
...@@ -314,6 +316,7 @@ static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; ...@@ -314,6 +316,7 @@ static LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
int multi_thread=1; int multi_thread=1;
uint32_t target_dl_mcs = 28; //maximum allowed mcs uint32_t target_dl_mcs = 28; //maximum allowed mcs
uint32_t target_ul_mcs = 10; uint32_t target_ul_mcs = 10;
uint32_t timing_advance = 0;
uint8_t exit_missed_slots=1; uint8_t exit_missed_slots=1;
uint64_t num_missed_slots=0; // counter for the number of missed slots uint64_t num_missed_slots=0; // counter for the number of missed slots
...@@ -418,7 +421,7 @@ void help (void) { ...@@ -418,7 +421,7 @@ void help (void) {
printf(" --ue-txgain set UE TX gain\n"); printf(" --ue-txgain set UE TX gain\n");
printf(" --ue-scan_carrier set UE to scan around carrier\n"); printf(" --ue-scan_carrier set UE to scan around carrier\n");
printf(" --loop-memory get softmodem (UE) to loop through memory instead of acquiring from HW\n"); printf(" --loop-memory get softmodem (UE) to loop through memory instead of acquiring from HW\n");
printf(" -C Set the downlink frequecny for all Component carrier\n"); printf(" -C Set the downlink frequency for all component carriers\n");
printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n"); printf(" -d Enable soft scope and L1 and L2 stats (Xforms)\n");
printf(" -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"); printf(" -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n");
printf(" -g Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n"); printf(" -g Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n");
...@@ -432,6 +435,7 @@ void help (void) { ...@@ -432,6 +435,7 @@ void help (void) {
printf(" -r Set the PRB, valid values: 6, 25, 50, 100 \n"); printf(" -r Set the PRB, valid values: 6, 25, 50, 100 \n");
printf(" -S Skip the missed slots/subframes \n"); printf(" -S Skip the missed slots/subframes \n");
printf(" -t Set the maximum uplink MCS\n"); printf(" -t Set the maximum uplink MCS\n");
printf(" -T Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n");
printf(" -U Set the lte softmodem as a UE\n"); printf(" -U Set the lte softmodem as a UE\n");
printf(" -W Enable L2 wireshark messages on localhost \n"); printf(" -W Enable L2 wireshark messages on localhost \n");
printf(" -V Enable VCD (generated file will be located atopenair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n"); printf(" -V Enable VCD (generated file will be located atopenair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n");
...@@ -966,6 +970,25 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB) ...@@ -966,6 +970,25 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset++] = 0x00010001; phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset++] = 0x00010001;
} }
} }
if ((((phy_vars_eNB->lte_frame_parms.tdd_config==0) ||
(phy_vars_eNB->lte_frame_parms.tdd_config==1) ||
(phy_vars_eNB->lte_frame_parms.tdd_config==2) ||
(phy_vars_eNB->lte_frame_parms.tdd_config==6)) &&
(subframe==0)) || (subframe==5)) {
// turn on tx switch N_TA_offset before
//LOG_D(HW,"subframe %d, time to switch to tx (N_TA_offset %d, slot_offset %d) \n",subframe,phy_vars_eNB->N_TA_offset,slot_offset);
for (i=0; i<phy_vars_eNB->N_TA_offset; i++) {
tx_offset = (int)slot_offset+time_offset[aa]+i-phy_vars_eNB->N_TA_offset/2;
if (tx_offset<0)
tx_offset += LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti;
if (tx_offset>=(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti))
tx_offset -= LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti;
phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset] = 0x00000000;
}
}
} }
} }
} }
...@@ -2039,7 +2062,7 @@ static void get_options (int argc, char **argv) ...@@ -2039,7 +2062,7 @@ static void get_options (int argc, char **argv)
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
while ((c = getopt_long (argc, argv, "C:dK:g:F:G:hqO:m:SUVRM:r:P:Ws:t:x:",long_options,NULL)) != -1) { while ((c = getopt_long (argc, argv, "A:a:C:dK:g:F:G:hqO:m:SUVRM:r:P:Ws:t:Tx:",long_options,NULL)) != -1) {
switch (c) { switch (c) {
case LONG_OPTION_MAXPOWER: case LONG_OPTION_MAXPOWER:
tx_max_power[0]=atoi(optarg); tx_max_power[0]=atoi(optarg);
...@@ -2114,6 +2137,10 @@ static void get_options (int argc, char **argv) ...@@ -2114,6 +2137,10 @@ static void get_options (int argc, char **argv)
#endif #endif
break; break;
case 'A':
timing_advance = atoi (optarg);
break;
case 'C': case 'C':
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
downlink_frequency[CC_id][0] = atof(optarg); // Use float to avoid issue with frequency over 2^31. downlink_frequency[CC_id][0] = atof(optarg); // Use float to avoid issue with frequency over 2^31.
...@@ -2127,6 +2154,10 @@ static void get_options (int argc, char **argv) ...@@ -2127,6 +2154,10 @@ static void get_options (int argc, char **argv)
break; break;
case 'a':
chain_offset = atoi(optarg);
break;
case 'd': case 'd':
#ifdef XFORMS #ifdef XFORMS
do_forms=1; do_forms=1;
...@@ -2304,8 +2335,13 @@ static void get_options (int argc, char **argv) ...@@ -2304,8 +2335,13 @@ static void get_options (int argc, char **argv)
printf("Transmission mode > 2 (%d) not supported for the moment\n",transmission_mode); printf("Transmission mode > 2 (%d) not supported for the moment\n",transmission_mode);
exit(-1); exit(-1);
} }
break;
case 'T':
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
frame_parms[CC_id]->frame_type = TDD;
break; break;
case 'h': case 'h':
help (); help ();
exit (-1); exit (-1);
...@@ -2465,12 +2501,10 @@ int main( int argc, char **argv ) ...@@ -2465,12 +2501,10 @@ int main( int argc, char **argv )
memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs); memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
set_latency_target(); set_latency_target();
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] = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS)); frame_parms[CC_id] = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
/* Set some default values that may be overwritten while reading options */ /* Set some default values that may be overwritten while reading options */
frame_parms[CC_id]->frame_type = FDD; /* TDD */ frame_parms[CC_id]->frame_type = FDD;
frame_parms[CC_id]->tdd_config = 3; frame_parms[CC_id]->tdd_config = 3;
frame_parms[CC_id]->tdd_config_S = 0; frame_parms[CC_id]->tdd_config_S = 0;
frame_parms[CC_id]->N_RB_DL = 100; frame_parms[CC_id]->N_RB_DL = 100;
...@@ -2767,7 +2801,7 @@ int main( int argc, char **argv ) ...@@ -2767,7 +2801,7 @@ int main( int argc, char **argv )
PHY_vars_eNB_g[0] = malloc(sizeof(PHY_VARS_eNB*)); PHY_vars_eNB_g[0] = malloc(sizeof(PHY_VARS_eNB*));
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,Nid_cell,cooperation_flag,transmission_mode,abstraction_flag); PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,frame_parms[CC_id]->Nid_cell,cooperation_flag,transmission_mode,abstraction_flag);
PHY_vars_eNB_g[0][CC_id]->CC_id = CC_id; PHY_vars_eNB_g[0][CC_id]->CC_id = CC_id;
#ifndef OPENAIR2 #ifndef OPENAIR2
...@@ -2818,7 +2852,7 @@ int main( int argc, char **argv ) ...@@ -2818,7 +2852,7 @@ int main( int argc, char **argv )
} }
#else #else
//already taken care of in lte-softmodem //already taken care of in lte-softmodem.c
PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 0; PHY_vars_eNB_g[0][CC_id]->N_TA_offset = 0;
#endif #endif
...@@ -2856,8 +2890,8 @@ int main( int argc, char **argv ) ...@@ -2856,8 +2890,8 @@ int main( int argc, char **argv )
} else if (frame_parms[0]->N_RB_DL == 25) { } else if (frame_parms[0]->N_RB_DL == 25) {
openair0_cfg[card].sample_rate=7.68e6; openair0_cfg[card].sample_rate=7.68e6;
openair0_cfg[card].samples_per_frame = 76800; openair0_cfg[card].samples_per_frame = 76800;
openair0_cfg[card].tx_bw = 2.5e6; openair0_cfg[card].tx_bw = 5e6;
openair0_cfg[card].rx_bw = 2.5e6; openair0_cfg[card].rx_bw = 5e6;
} else if (frame_parms[0]->N_RB_DL == 6) { } else if (frame_parms[0]->N_RB_DL == 6) {
openair0_cfg[card].sample_rate=1.92e6; openair0_cfg[card].sample_rate=1.92e6;
...@@ -2865,7 +2899,12 @@ int main( int argc, char **argv ) ...@@ -2865,7 +2899,12 @@ int main( int argc, char **argv )
openair0_cfg[card].tx_bw = 1.5e6; openair0_cfg[card].tx_bw = 1.5e6;
openair0_cfg[card].rx_bw = 1.5e6; openair0_cfg[card].rx_bw = 1.5e6;
} }
if (frame_parms[0]->frame_type==TDD)
openair0_cfg[card].duplex_mode = duplex_mode_TDD;
else //FDD
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
#ifdef ETHERNET #ifdef ETHERNET
//calib needed //calib needed
...@@ -3031,13 +3070,13 @@ int main( int argc, char **argv ) ...@@ -3031,13 +3070,13 @@ int main( int argc, char **argv )
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
rf_map[CC_id].card=0; rf_map[CC_id].card=0;
rf_map[CC_id].chain=CC_id; rf_map[CC_id].chain=CC_id+chain_offset;
} }
// connect the TX/RX buffers // connect the TX/RX buffers
if (UE_flag==1) { if (UE_flag==1) {
#ifdef OAI_USRP #ifdef OAI_USRP
openair_daq_vars.timing_advance = 0; openair_daq_vars.timing_advance = timing_advance;
#else #else
openair_daq_vars.timing_advance = 160; openair_daq_vars.timing_advance = 160;
#endif #endif
......
...@@ -1020,6 +1020,10 @@ void *UE_thread(void *arg) ...@@ -1020,6 +1020,10 @@ void *UE_thread(void *arg)
openair0_timestamp timestamp; openair0_timestamp timestamp;
#ifdef NAS_UE
MessageDef *message_p;
#endif
#ifdef RTAI #ifdef RTAI
RT_TASK *task = rt_task_init_schmod(nam2num("UE thread"), 0, 0, 0, SCHED_FIFO, 0xF); RT_TASK *task = rt_task_init_schmod(nam2num("UE thread"), 0, 0, 0, SCHED_FIFO, 0xF);
...@@ -1075,6 +1079,11 @@ void *UE_thread(void *arg) ...@@ -1075,6 +1079,11 @@ void *UE_thread(void *arg)
printf("starting UE thread\n"); printf("starting UE thread\n");
#ifdef NAS_UE
message_p = itti_alloc_new_message(TASK_NAS_UE, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_NAS_UE, INSTANCE_DEFAULT, message_p);
#endif
T0 = rt_get_time_ns(); T0 = rt_get_time_ns();
first_rx = 1; first_rx = 1;
rxpos=0; rxpos=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