Commit a77082c1 authored by Cedric Roux's avatar Cedric Roux

Merge branch 'develop_integration_w12' into 'develop'

develop_integration_w12 into develop

Summary of changes:
- RRC Rel14: tests done so far indicate no problem
- SRS support in eNB
- bug fixes / warning removals

See merge request !155
parents bd173433 b6991ab2
...@@ -283,8 +283,10 @@ if (${RRC_ASN1_VERSION} STREQUAL "Rel8") ...@@ -283,8 +283,10 @@ if (${RRC_ASN1_VERSION} STREQUAL "Rel8")
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-86.asn) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-86.asn)
elseif (${RRC_ASN1_VERSION} STREQUAL "CBA") elseif (${RRC_ASN1_VERSION} STREQUAL "CBA")
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn)
else() elseif (${RRC_ASN1_VERSION} STREQUAL "Rel10")
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20.asn) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20.asn)
else()
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1c/ASN1_files/RRC-e10.asn)
endif (${RRC_ASN1_VERSION} STREQUAL "Rel8") endif (${RRC_ASN1_VERSION} STREQUAL "Rel8")
set (RRC_FULL_DIR ${asn1_generated_dir}/${RRC_ASN1_VERSION}) set (RRC_FULL_DIR ${asn1_generated_dir}/${RRC_ASN1_VERSION})
...@@ -1769,6 +1771,7 @@ add_executable(lte-softmodem ...@@ -1769,6 +1771,7 @@ add_executable(lte-softmodem
${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
${GTPU_need_ITTI} ${GTPU_need_ITTI}
${HW_SOURCE} ${HW_SOURCE}
${TRANSPORT_SOURCE} ${TRANSPORT_SOURCE}
...@@ -1805,6 +1808,7 @@ add_executable(lte-softmodem-nos1 ...@@ -1805,6 +1808,7 @@ add_executable(lte-softmodem-nos1
${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR_DIR}/common/utils/system.c
${HW_SOURCE} ${HW_SOURCE}
${TRANSPORT_SOURCE} ${TRANSPORT_SOURCE}
${RTAI_SOURCE} ${RTAI_SOURCE}
...@@ -1900,6 +1904,7 @@ add_executable(oaisim ...@@ -1900,6 +1904,7 @@ add_executable(oaisim
${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.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
${GTPU_need_ITTI} ${GTPU_need_ITTI}
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
${HW_SOURCE} ${HW_SOURCE}
...@@ -1946,6 +1951,7 @@ add_executable(oaisim_nos1 ...@@ -1946,6 +1951,7 @@ add_executable(oaisim_nos1
${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_DIR}/common/utils/system.c
${HW_SOURCE} ${HW_SOURCE}
${TRANSPORT_SOURCE} ${TRANSPORT_SOURCE}
${XFORMS_SOURCE} ${XFORMS_SOURCE}
......
...@@ -716,6 +716,7 @@ ADD_EXECUTABLE(at_nas_ue ${OPENAIR_NAS_DIR}/UE/UEprocess.c ...@@ -716,6 +716,7 @@ ADD_EXECUTABLE(at_nas_ue ${OPENAIR_NAS_DIR}/UE/UEprocess.c
${OPENAIR_NAS_DIR}/UE/nas_proc.c ${OPENAIR_NAS_DIR}/UE/nas_proc.c
${OPENAIR_NAS_DIR}/UE/nas_user.c ${OPENAIR_NAS_DIR}/UE/nas_user.c
${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
) )
target_link_libraries (at_nas_ue target_link_libraries (at_nas_ue
......
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
sudo /opt/ltebox/tools/stop_ltebox || true sudo /opt/ltebox/tools/stop_ltebox || true
sudo /opt/hss_sim0609/starthss_real sudo /opt/hss_sim0609/starthss_real
cd /tmp/oai_test_setup/oai cd /tmp/oai_test_setup/oai
source oaienv source oaienv
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
cd cmake_targets cd cmake_targets
rm -rf log rm -rf log
mkdir -p log mkdir -p log
......
...@@ -3,6 +3,8 @@ stty isig intr ^C ...@@ -3,6 +3,8 @@ stty isig intr ^C
cd /tmp/oai_test_setup/oai cd /tmp/oai_test_setup/oai
source oaienv source oaienv
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
cd cmake_targets/lte_build_oai/build cd cmake_targets/lte_build_oai/build
ulimit -c unlimited ulimit -c unlimited
sudo rm -f core sudo rm -f core
......
...@@ -3,6 +3,8 @@ stty isig intr ^C ...@@ -3,6 +3,8 @@ stty isig intr ^C
cd /tmp/oai_test_setup/oai cd /tmp/oai_test_setup/oai
source oaienv source oaienv
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
cd cmake_targets/autotests/v2/actions cd cmake_targets/autotests/v2/actions
sudo python start_3276.py sudo python start_3276.py
......
...@@ -16,6 +16,8 @@ stty isig intr ^C ...@@ -16,6 +16,8 @@ stty isig intr ^C
cd /tmp/oai_test_setup/oai cd /tmp/oai_test_setup/oai
source oaienv source oaienv
sudo rmmod nasmesh || true
sudo rmmod ue_ip || true
cd cmake_targets/autotests/v2/actions cd cmake_targets/autotests/v2/actions
python start_bandrich.py python start_bandrich.py
......
...@@ -41,7 +41,7 @@ VCD_TIMING="False" ...@@ -41,7 +41,7 @@ VCD_TIMING="False"
DEADLINE_SCHEDULER_FLAG_USER="False" DEADLINE_SCHEDULER_FLAG_USER="False"
FORCE_DEADLINE_SCHEDULER_FLAG_USER="" FORCE_DEADLINE_SCHEDULER_FLAG_USER=""
CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False
REL="Rel10" REL="Rel14"
HW="None" HW="None"
TP="None" TP="None"
NOS1=0 NOS1=0
...@@ -95,8 +95,9 @@ Options ...@@ -95,8 +95,9 @@ Options
-a | --agent -a | --agent
Enables agent for software-defined control of the eNB Enables agent for software-defined control of the eNB
-r | --3gpp-release -r | --3gpp-release
default is Rel10, default is Rel14,
Rel8 limits the implementation to 3GPP Release 8 version Rel8 limits the implementation to 3GPP Release 8 version
Rel10 limits the implementation to 3GPP Release 10 version
-w | --hardware -w | --hardware
EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default) EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)
Adds this RF board support (in external packages installation and in compilation) Adds this RF board support (in external packages installation and in compilation)
......
...@@ -3,19 +3,16 @@ ...@@ -3,19 +3,16 @@
# in those arrays, each line is: # in those arrays, each line is:
# <file> <sha1sum of file (without line 4 which changes depending on the location of the files)> <patch to apply to file> # <file> <sha1sum of file (without line 4 which changes depending on the location of the files)> <patch to apply to file>
RRC_Rel14=(
"SystemInformation-r8-IEs.h" 562e3c3aeb7c6d76d722f31bf24488a26e627f33 "fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff"
)
RRC_Rel10=( RRC_Rel10=(
"SystemInformation-r8-IEs.h" 603cd6615cff36ec7020692d72c0d6de7c4859cb "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff" "SystemInformation-r8-IEs.h" 603cd6615cff36ec7020692d72c0d6de7c4859cb "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff"
) )
X2AP_Rel11_2=( X2AP_Rel11_2=(
"X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff" "X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff"
"NativeInteger.c" 1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff"
"constr_SET_OF.c" 808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff"
)
S1AP_Rel10_5=(
"NativeInteger.c" 1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff"
"constr_SET_OF.c" 808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff"
) )
red_color="$(tput setaf 1)" red_color="$(tput setaf 1)"
...@@ -94,6 +91,10 @@ function patch_rrc() ...@@ -94,6 +91,10 @@ function patch_rrc()
local version="$2" local version="$2"
case "$version" in case "$version" in
Rel14 )
echo "patching RRC files release 14"
apply_patches "$directory" RRC_Rel14 ${#RRC_Rel14[*]}
;;
Rel10 ) Rel10 )
echo "patching RRC files release 10" echo "patching RRC files release 10"
apply_patches "$directory" RRC_Rel10 ${#RRC_Rel10[*]} apply_patches "$directory" RRC_Rel10 ${#RRC_Rel10[*]}
...@@ -130,8 +131,7 @@ function patch_s1ap() ...@@ -130,8 +131,7 @@ function patch_s1ap()
case "$version" in case "$version" in
R10 ) R10 )
echo "patching S1AP files release 10.5" #nothing to do anymore (fixes went to asn1c)
apply_patches "$directory" S1AP_Rel10_5 ${#S1AP_Rel10_5[*]}
;; ;;
* ) * )
error unknwon/unhandled S1AP version \'"$version"\' error unknwon/unhandled S1AP version \'"$version"\'
......
73,77d72
< /* SystemInformation-r8-IEs */
< typedef struct SystemInformation_r8_IEs {
< struct SystemInformation_r8_IEs__sib_TypeAndInfo {
< A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
< SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
103c98,102
< } choice;
---
> };
>
> struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
> SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
> union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice;
107c106,111
< } ) list;
---
> };
>
> /* SystemInformation-r8-IEs */
> typedef struct SystemInformation_r8_IEs {
> struct SystemInformation_r8_IEs__sib_TypeAndInfo {
> A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list;
283c283
< int dynamic = 0;
---
> //int dynamic = 0;
290c290
< dynamic = 1;
---
> //dynamic = 1;
1007c1007
< (int)nelems, (int)ct ? ct->effective_bits : -1);
---
> (int)nelems, ct ? ct->effective_bits : -1);
283c283
< int dynamic = 0;
---
> //int dynamic = 0;
290c290
< dynamic = 1;
---
> //dynamic = 1;
1007c1007
< (int)nelems, (int)ct ? ct->effective_bits : -1);
---
> (int)nelems, ct ? ct->effective_bits : -1);
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/* This module provides a separate process to run system().
* The communication between this process and the main processing
* is done through unix pipes.
*
* Motivation: the UE sets its IP address using system() and
* that disrupts realtime processing in some cases. Having a
* separate process solves this problem.
*/
#include "system.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <string.h>
#define MAX_COMMAND 4096
static int command_pipe_read;
static int command_pipe_write;
static int result_pipe_read;
static int result_pipe_write;
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static int module_initialized = 0;
/********************************************************************/
/* util functions */
/********************************************************************/
static void lock_system(void)
{
if (pthread_mutex_lock(&lock) != 0) {
printf("pthread_mutex_lock fails\n");
abort();
}
}
static void unlock_system(void)
{
if (pthread_mutex_unlock(&lock) != 0) {
printf("pthread_mutex_unlock fails\n");
abort();
}
}
static void write_pipe(int p, char *b, int size)
{
while (size) {
int ret = write(p, b, size);
if (ret <= 0) exit(0);
b += ret;
size -= ret;
}
}
static void read_pipe(int p, char *b, int size)
{
while (size) {
int ret = read(p, b, size);
if (ret <= 0) exit(0);
b += ret;
size -= ret;
}
}
/********************************************************************/
/* background process */
/********************************************************************/
/* This function is run by background process. It waits for a command,
* runs it, and reports status back. It exits (in normal situations)
* when the main process exits, because then a "read" on the pipe
* will return 0, in which case "read_pipe" exits.
*/
static void background_system_process(void)
{
int len;
int ret;
char command[MAX_COMMAND+1];
while (1) {
read_pipe(command_pipe_read, (char*)&len, sizeof(int));
read_pipe(command_pipe_read, command, len);
ret = system(command);
write_pipe(result_pipe_write, (char *)&ret, sizeof(int));
}
}
/********************************************************************/
/* background_system() */
/* return -1 on error, 0 on success */
/********************************************************************/
int background_system(char *command)
{
int res;
int len;
if (module_initialized == 0) {
printf("FATAL: calling 'background_system' but 'start_background_system' was not called\n");
abort();
}
len = strlen(command)+1;
if (len > MAX_COMMAND) {
printf("FATAL: command too long. Increase MAX_COMMAND (%d).\n", MAX_COMMAND);
printf("command was: '%s'\n", command);
abort();
}
/* only one command can run at a time, so let's lock/unlock */
lock_system();
write_pipe(command_pipe_write, (char*)&len, sizeof(int));
write_pipe(command_pipe_write, command, len);
read_pipe(result_pipe_read, (char*)&res, sizeof(int));
unlock_system();
if (res == -1 || !WIFEXITED(res) || WEXITSTATUS(res) != 0) return -1;
return 0;
}
/********************************************************************/
/* start_background_system() */
/* initializes the "background system" module */
/* to be called very early by the main processing */
/********************************************************************/
void start_background_system(void)
{
int p[2];
pid_t son;
module_initialized = 1;
if (pipe(p) == -1) {
perror("pipe");
exit(1);
}
command_pipe_read = p[0];
command_pipe_write = p[1];
if (pipe(p) == -1) {
perror("pipe");
exit(1);
}
result_pipe_read = p[0];
result_pipe_write = p[1];
son = fork();
if (son == -1) {
perror("fork");
exit(1);
}
if (son) {
close(result_pipe_write);
close(command_pipe_read);
return;
}
close(result_pipe_read);
close(command_pipe_write);
background_system_process();
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _SYSTEM_H_OAI_
#define _SYSTEM_H_OAI_
/****************************************************
* send a command to the background process
* return -1 on error, 0 on success
****************************************************/
int background_system(char *command);
/****************************************************
* initialize the background process
* to be called very early
****************************************************/
void start_background_system(void);
#endif /* _SYSTEM_H_OAI_ */
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "TDD-Config.h" #include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h" #include "MBSFN-SubframeConfigList.h"
#include "MobilityControlInfo.h" #include "MobilityControlInfo.h"
#ifdef Rel10 #if defined(Rel10) || defined(Rel14)
#include "SCellToAddMod-r10.h" #include "SCellToAddMod-r10.h"
#endif #endif
/** @addtogroup _PHY_STRUCTURES_ /** @addtogroup _PHY_STRUCTURES_
...@@ -317,7 +317,7 @@ void lte_param_init(unsigned char N_tx_port_eNB, ...@@ -317,7 +317,7 @@ void lte_param_init(unsigned char N_tx_port_eNB,
uint8_t osf, uint8_t osf,
uint32_t perfect_ce); uint32_t perfect_ce);
#ifdef Rel10 #if defined(Rel10) || defined(Rel14)
void phy_config_dedicated_scell_ue(uint8_t Mod_id, void phy_config_dedicated_scell_ue(uint8_t Mod_id,
uint8_t eNB_index, uint8_t eNB_index,
SCellToAddMod_r10_t *sCellToAddMod_r10, SCellToAddMod_r10_t *sCellToAddMod_r10,
......
...@@ -483,7 +483,8 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB) ...@@ -483,7 +483,8 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) { if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) {
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) { if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) {
eNB->soundingrs_ul_config_dedicated[UE_id].srsConfigDedicatedSetup = 1;
eNB->soundingrs_ul_config_dedicated[UE_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration; eNB->soundingrs_ul_config_dedicated[UE_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration;
eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift; eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift;
eNB->soundingrs_ul_config_dedicated[UE_id].freqDomainPosition = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition; eNB->soundingrs_ul_config_dedicated[UE_id].freqDomainPosition = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
...@@ -706,7 +707,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id, ...@@ -706,7 +707,7 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
} }
} }
#ifdef Rel10 #if defined(Rel10) || defined(Rel14)
void phy_config_dedicated_scell_ue(uint8_t Mod_id, void phy_config_dedicated_scell_ue(uint8_t Mod_id,
uint8_t eNB_index, uint8_t eNB_index,
SCellToAddMod_r10_t *sCellToAddMod_r10, SCellToAddMod_r10_t *sCellToAddMod_r10,
...@@ -1213,7 +1214,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, ...@@ -1213,7 +1214,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
} }
const size_t num = 7*2*fp->N_RB_DL*12+4; //const size_t num = 7*2*fp->N_RB_DL*12+4;
for (k=0;k<8;k++) { //harq_pid for (k=0;k<8;k++) { //harq_pid
for (l=0;l<8;l++) { //round for (l=0;l<8;l++) { //round
pdsch_vars_th0[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdsch_vars_th0[eNB_id]->rxdataF_comp1[k][l] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
......
...@@ -667,28 +667,28 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB, ...@@ -667,28 +667,28 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
} }
extern uint16_t transmission_offset_tdd[16]; extern uint16_t transmission_offset_tdd[16];
#define DEBUG_SRS //#define DEBUG_SRS
int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
LTE_eNB_COMMON *common_vars, LTE_eNB_COMMON *common_vars,
LTE_eNB_SRS *srs_vars, LTE_eNB_SRS *srs_vars,
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated, SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated,
unsigned char sub_frame_number, unsigned char subframe,
unsigned char eNB_id) unsigned char eNB_id)
{ {
int T_SFC,aa; int aa;
int N_symb,symbol; int N_symb,symbol;
uint8_t nb_antennas_rx = frame_parms->nb_antenna_ports_eNB; uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
#ifdef DEBUG_SRS #ifdef DEBUG_SRS
char fname[40], vname[40]; char fname[40], vname[40];
#endif #endif
uint8_t Ssrs = frame_parms->soundingrs_ul_config_common.srs_SubframeConfig; //uint8_t Ssrs = frame_parms->soundingrs_ul_config_common.srs_SubframeConfig;
//uint8_t T_SFC = (Ssrs<=7 ? 5 : 10);
N_symb = 2*7-frame_parms->Ncp; N_symb = 2*7-frame_parms->Ncp;
symbol = (sub_frame_number+1)*N_symb-1; //SRS is always in last symbol of subframe symbol = N_symb-1; //SRS is always in last symbol of subframe
T_SFC = (Ssrs<=7 ? 5 : 10);
/* /*
msg("SRS channel estimation eNB %d, subframs %d, %d %d %d %d %d\n",eNB_id,sub_frame_number, msg("SRS channel estimation eNB %d, subframs %d, %d %d %d %d %d\n",eNB_id,sub_frame_number,
...@@ -699,19 +699,21 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -699,19 +699,21 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
SRS_parms->Ssrs); SRS_parms->Ssrs);
*/ */
if ((1<<(sub_frame_number%T_SFC))&transmission_offset_tdd[Ssrs]) { //if ((1<<(sub_frame_number%T_SFC))&transmission_offset_tdd[Ssrs]) {
if (generate_srs_rx(frame_parms, if (generate_srs(frame_parms,
soundingrs_ul_config_dedicated, soundingrs_ul_config_dedicated,
srs_vars->srs)==-1) { &srs_vars->srs[eNB_id],
msg("lte_srs_channel_estimation: Error in generate_srs_rx\n"); 0x7FFF,
subframe)==-1) {
LOG_E(PHY,"lte_srs_channel_estimation: Error in generate_srs_rx\n");
return(-1); return(-1);
} }
for (aa=0; aa<nb_antennas_rx; aa++) { for (aa=0; aa<nb_antennas_rx; aa++) {
#ifdef DEBUG_SRS #ifdef DEBUG_SRS
msg("SRS channel estimation eNB %d, subframs %d, aarx %d, %p, %p, %p\n",eNB_id,sub_frame_number,aa, msg("SRS channel estimation eNB %d, subframs %d, aarx %d, %p, %p, %p\n",eNB_id,sub_frame_number,aa,
&common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol], &common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],
srs_vars->srs, srs_vars->srs,
srs_vars->srs_ch_estimates[eNB_id][aa]); srs_vars->srs_ch_estimates[eNB_id][aa]);
#endif #endif
...@@ -719,14 +721,15 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -719,14 +721,15 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
//write_output("eNB_rxF.m","rxF",&common_vars->rxdataF[0][aa][2*frame_parms->ofdm_symbol_size*symbol],2*(frame_parms->ofdm_symbol_size),2,1); //write_output("eNB_rxF.m","rxF",&common_vars->rxdataF[0][aa][2*frame_parms->ofdm_symbol_size*symbol],2*(frame_parms->ofdm_symbol_size),2,1);
//write_output("eNB_srs.m","srs_eNB",common_vars->srs,(frame_parms->ofdm_symbol_size),1,1); //write_output("eNB_srs.m","srs_eNB",common_vars->srs,(frame_parms->ofdm_symbol_size),1,1);
mult_cpx_conj_vector((int16_t*) &common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol], //memcpy(srs_vars->srs_ch_estimates[eNB_id][aa],&srs_vars->srs[eNB_id],frame_parms->ofdm_symbol_size*sizeof(int32_t));
(int16_t*) srs_vars->srs, //memcpy(srs_vars->srs_ch_estimates[eNB_id][aa],&common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],frame_parms->ofdm_symbol_size*sizeof(int32_t));
mult_cpx_conj_vector((int16_t*) &common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],
(int16_t*) &srs_vars->srs[eNB_id],
(int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa], (int16_t*) srs_vars->srs_ch_estimates[eNB_id][aa],
frame_parms->ofdm_symbol_size, frame_parms->ofdm_symbol_size,
15, 15,
0); 0);
//msg("SRS channel estimation cmult out\n");
#ifdef USER_MODE #ifdef USER_MODE