Commit b72ca3ee authored by knopp's avatar knopp

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6348 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 613088f3
......@@ -616,7 +616,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
}
#ifndef PERFECT_CE
if (phy_vars_ue->perfect_ce == 0) {
// Temporal Interpolation
// printf("ch_offset %d\n",ch_offset);
......@@ -691,7 +691,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
}
}
#endif
}
}
void (*idft)(int16_t *,int16_t *, int);
......
......@@ -153,7 +153,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
}
#ifndef PERFECT_CE
if (phy_vars_ue->perfect_ce == 0) {
if ((l==0) || (l==(4-frame_parms->Ncp))) {
for (aa=0;aa<frame_parms->nb_antennas_tx_eNB;aa++) {
......@@ -193,7 +193,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
}
}
#endif
}
#ifdef DEBUG_FEP
msg("slot_fep: done\n");
#endif
......
......@@ -173,7 +173,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
// changed to invoke MBSFN channel estimation in symbols 2,6,10
if ((l==2)||(l==6)||(l==10)) {
for (aa=0;aa<frame_parms->nb_antennas_tx;aa++) {
#ifndef PERFECT_CE
if (phy_vars_ue->perfect_ce == 0) {
#ifdef DEBUG_FEP
msg("Channel estimation eNB %d, aatx %d, subframe %d, symbol %d\n",eNB_id,aa,subframe,l);
#endif
......@@ -201,7 +201,6 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
l,
symbol); */
// }
#endif
// do frequency offset estimation here!
// use channel estimates from current symbol (=ch_t) and last symbol (ch_{t-1})
......@@ -215,6 +214,7 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
l,
&ue_common_vars->freq_offset); */
}
}
}
#ifdef DEBUG_FEP
msg("slot_fep_mbsfn: done\n");
......
......@@ -434,6 +434,7 @@ typedef struct
uint32_t X_u[64][839];
uint32_t high_speed_flag;
uint32_t perfect_ce;
int16_t ch_est_alpha;
char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
......
......@@ -1905,10 +1905,12 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
eNB_id,subframe_rx);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT);
//LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d PHICH RX\n",phy_vars_ue->Mod_id,frame_rx,subframe_rx);
if (is_phich_subframe(&phy_vars_ue->lte_frame_parms,subframe_rx)) {
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PHICH, VCD_FUNCTION_IN);
rx_phich(phy_vars_ue,
subframe_rx,eNB_id);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PHICH, VCD_FUNCTION_OUT);
}
}
#ifdef PHY_ABSTRACTION
......@@ -2318,6 +2320,9 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
int CC_id = phy_vars_ue->CC_id;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_UE, (slot_rx + 1) % 20);
vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_UE, frame_rx);
start_meas(&phy_vars_ue->phy_proc_rx);
#ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[%s %d] Frame %d subframe %d: Doing phy_procedures_UE_RX(%d)\n",
......@@ -3426,8 +3431,6 @@ void phy_UE_lte_check_measurement_thresholds(instance_t instanceP, ral_threshold
prach_resources_local.ra_PreambleIndex = 0;
#endif
vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_UE, (slot_rx + 1) % 20);
vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_UE, frame_rx);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1);
#ifdef EXMIMO
......
......@@ -73,7 +73,6 @@ extern unsigned char offset_mumimo_llr_drange_fix;
//#define ABSTRACTION
//#define PERFECT_CE
/*
#define RBmask0 0x00fc00fc
......@@ -107,7 +106,7 @@ void handler(int sig) {
exit(1);
}
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t fdd_flag, uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,uint8_t osf) {
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t fdd_flag, uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,uint8_t osf,uint32_t perfect_ce) {
LTE_DL_FRAME_PARMS *lte_frame_parms;
int i;
......@@ -186,6 +185,7 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1;
}
PHY_vars_UE->perfect_ce = perfect_ce;
printf("Done lte_param_init\n");
......@@ -344,6 +344,7 @@ int main(int argc, char **argv) {
char channel_model_input[10]="I";
int TB0_active = 1;
uint32_t perfect_ce = 0;
LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
......@@ -365,8 +366,9 @@ int main(int argc, char **argv) {
n_frames = 1000;
snr0 = 0;
num_layers = 1;
perfect_ce = 0;
while ((c = getopt (argc, argv, "ahdpZDe:m:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:")) != -1) {
while ((c = getopt (argc, argv, "ahdpZDe:m:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) {
switch (c)
{
case 'a':
......@@ -564,6 +566,9 @@ int main(int argc, char **argv) {
case 'Z':
dump_table=1;
break;
case 'Y':
perfect_ce=1;
break;
case 'h':
default:
printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs1 -M mcs2 -n n_frames -s snr0 -x transmission mode (1,2,5,6) -y TXant -z RXant -I trch_file\n",argv[0]);
......@@ -645,7 +650,7 @@ int main(int argc, char **argv) {
printf("dual_stream_UE=%d\n", dual_stream_UE);
}
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,fdd_flag,Nid_cell,tdd_config,N_RB_DL,osf);
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,fdd_flag,Nid_cell,tdd_config,N_RB_DL,osf,perfect_ce);
eNB_id_i = PHY_vars_UE->n_connected_eNB;
......@@ -2718,7 +2723,7 @@ int main(int argc, char **argv) {
0,
0);
stop_meas(&PHY_vars_UE->ofdm_demod_stats);
#ifdef PERFECT_CE
if (PHY_vars_UE->perfect_ce==1) {
if (awgn_flag==0) {
// fill in perfect channel estimates
freq_channel(eNB2UE[round],PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1);
......@@ -2751,7 +2756,7 @@ int main(int argc, char **argv) {
}
}
}
#endif
}
if ((Ns==((2*subframe))) && (l==0)) {
......
......@@ -60,7 +60,7 @@
PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE;
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,lte_frame_type_t frame_type, uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,uint8_t osf) {
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,lte_frame_type_t frame_type, uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,uint8_t osf,uint32_t perfect_ce) {
LTE_DL_FRAME_PARMS *lte_frame_parms;
......@@ -121,7 +121,8 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
phy_init_lte_ue(PHY_vars_UE,1,0);
phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
PHY_vars_UE->perfect_ce = perfect_ce;
printf("Done lte_param_init\n");
......@@ -174,6 +175,7 @@ int main(int argc, char **argv) {
uint8_t N_RB_DL=25,osf=1;
double BW=5.0;
uint32_t perfect_ce = 0;
lte_frame_type_t frame_type = FDD;
......@@ -201,7 +203,7 @@ int main(int argc, char **argv) {
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
*/
while ((c = getopt (argc, argv, "ahA:Cp:n:s:S:t:x:y:z:N:F:R:O:dm:i:")) != -1)
while ((c = getopt (argc, argv, "ahA:Cp:n:s:S:t:x:y:z:N:F:R:O:dm:i:Y")) != -1)
{
switch (c)
{
......@@ -266,6 +268,9 @@ int main(int argc, char **argv) {
case 'O':
osf = atoi(optarg);
break;
case 'Y':
perfect_ce = 1;
break;
default:
case 'h':
printf("%s -h(elp) -p(subframe) -N cell_id -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -i snr increment -z RXant \n",argv[0]);
......@@ -309,7 +314,7 @@ int main(int argc, char **argv) {
if (transmission_mode==2)
n_tx=2;
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,tdd_config,N_RB_DL,osf);
lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,tdd_config,N_RB_DL,osf,perfect_ce);
......
......@@ -59,7 +59,7 @@ PHY_VARS_UE *PHY_vars_UE;
#define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,lte_frame_type_t frame_type,uint8_t osf) {
void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,lte_frame_type_t frame_type,uint8_t osf,uint32_t perfect_ce) {
unsigned int i;
LTE_DL_FRAME_PARMS *lte_frame_parms;
......@@ -135,6 +135,7 @@ void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmi
PHY_vars_UE->PHY_measurements.n_adj_cells=2;
PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
PHY_vars_UE->perfect_ce = perfect_ce;
for (i=0;i<3;i++)
lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
......@@ -548,10 +549,9 @@ int main(int argc, char **argv) {
int re_offset;
uint32_t *txptr;
int aarx;
#ifdef PERFECT_CE
int k;
#endif
double BW=5.0;
uint32_t perfect_ce = 0;
number_of_cards = 1;
openair_daq_vars.rx_rf_mode = 1;
......@@ -565,7 +565,7 @@ int main(int argc, char **argv) {
rxdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
rxdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
*/
while ((c = getopt (argc, argv, "hapFg:R:c:n:s:x:y:z:L:M:N:I:f:i:S:P:")) != -1) {
while ((c = getopt (argc, argv, "hapFg:R:c:n:s:x:y:z:L:M:N:I:f:i:S:P:Y")) != -1) {
switch (c)
{
case 'a':
......@@ -699,6 +699,9 @@ int main(int argc, char **argv) {
case 'P':
num_phich_interf=atoi(optarg);
break;
case 'Y':
perfect_ce = 1;
break;
case 'h':
printf("%s -h(elp) -a(wgn on) -c tdd_config -n n_frames -r RiceanFactor -s snr0 -t Delayspread -x transmission mode (1,2,6) -y TXant -z RXant -L AggregLevelUEspec -M AggregLevelCommonDCI -N DCIFormat\n\n",argv[0]);
printf("-h This message\n");
......@@ -757,7 +760,8 @@ int main(int argc, char **argv) {
Nid_cell,
tdd_config,
N_RB_DL,frame_type,
osf);
osf,
perfect_ce);
#ifdef XFORMS
fl_initialize (&argc, argv, NULL, 0, 0);
......@@ -1131,7 +1135,7 @@ int main(int argc, char **argv) {
0,
0);
#ifdef PERFECT_CE
if (PHY_vars_UE->perfect_ce == 1) {
if (awgn_flag==0) {
// fill in perfect channel estimates
freq_channel(eNB2UE,PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1);
......@@ -1164,8 +1168,7 @@ int main(int argc, char **argv) {
}
}
}
#endif
}
if (l==((PHY_vars_eNB->lte_frame_parms.Ncp==0)?4:3)) {
......
......@@ -567,7 +567,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
uint16_t TBS,i;
int32_t buffer_occupancy=0;
uint32_t cqi_req,cshift,ndi,mcs,rballoc,tpc;
int32_t normalized_rx_power, target_rx_power=-75;
int32_t normalized_rx_power, target_rx_power=-90;
static int32_t tpc_accumulated=0;
int n,CC_id;
......
......@@ -112,7 +112,7 @@ void mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB
}
int mac_top_init(int eMBMS_active, uint8_t cba_group_active, uint8_t HO_active){
int mac_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active){
module_id_t Mod_id,i,j;
RA_TEMPLATE *RA_template;
......@@ -185,7 +185,7 @@ int mac_top_init(int eMBMS_active, uint8_t cba_group_active, uint8_t HO_active){
if (Is_rrc_registered == 1){
LOG_I(MAC,"[MAIN] calling RRC\n");
#ifndef CELLULAR //nothing to be done yet for cellular
openair_rrc_top_init(eMBMS_active, cba_group_active,HO_active);
openair_rrc_top_init(eMBMS_active, uecap_xer, cba_group_active,HO_active);
#endif
}
else {
......@@ -401,7 +401,7 @@ void mac_top_cleanup(void){
free( Mac_rlc_xface);
}
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, uint8_t cba_group_active, uint8_t HO_active) {
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,uint8_t cba_group_active, uint8_t HO_active) {
......@@ -510,7 +510,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, uint8_t cba_group_
mac_xface->get_PHR = get_PHR;
LOG_D(MAC,"[MAIN] ALL INIT OK\n");
mac_xface->macphy_init(eMBMS_active,cba_group_active,HO_active);
mac_xface->macphy_init(eMBMS_active,uecap_xer,cba_group_active,HO_active);
//Mac_rlc_xface->Is_cluster_head[0] = 1;
//Mac_rlc_xface->Is_cluster_head[1] = 0;
......
......@@ -156,7 +156,7 @@ void chbch_phy_sync_success(module_id_t module_idP,frame_t frameP,uint8_t eNB_in
void mrbch_phy_sync_failure(module_id_t module_idP, frame_t frameP,uint8_t free_eNB_index);
int mac_top_init(int eMBMS_active, uint8_t cba_group_active, uint8_t HO_active);
int mac_top_init(int eMBMS_active, char *uecap_xer,uint8_t cba_group_active, uint8_t HO_active);
char layer2_init_UE(module_id_t module_idP);
......@@ -469,7 +469,7 @@ uint8_t *parse_ulsch_header(uint8_t *mac_header,
uint16_t tx_lenght);
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, uint8_t cba_group_active, uint8_t HO_active);
int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
int mac_init(void);
int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid);
int mac_remove_ue(module_id_t Mod_id, int UE_id,int frameP);
......
......@@ -63,7 +63,7 @@ do {
typedef struct
{
/// Pointer function that initializes L2
int (*macphy_init)(int eMBMS_active, uint8_t CBA_active,uint8_t HO_active);
int (*macphy_init)(int eMBMS_active, char *uecap_xer, uint8_t CBA_active,uint8_t HO_active);
/// Pointer function that stops the low-level scheduler due an exit condition
void (*macphy_exit)(const char *);
......
......@@ -356,7 +356,7 @@ uint8_t do_MIB(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame,
(void*)&mib,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -560,7 +560,7 @@ uint8_t do_SIB1(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer
(void*)bcch_message,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -1074,7 +1074,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
(void*)bcch_message,
buffer,
900);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -1164,7 +1164,7 @@ uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv) {
(void*)&ul_ccch_msg,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -1242,7 +1242,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin
(void*)&ul_dcch_msg,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -1296,7 +1296,7 @@ uint8_t do_RRCConnectionReconfigurationComplete(uint8_t Mod_id, uint8_t *buffer,
(void*)&ul_dcch_msg,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -1611,7 +1611,7 @@ uint8_t do_RRCConnectionSetup(uint8_t Mod_id,
(void*)&dl_ccch_msg,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -1678,7 +1678,7 @@ uint8_t do_SecurityModeCommand(uint8_t Mod_id,
(void*)&dl_dcch_msg,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -1745,7 +1745,7 @@ uint8_t do_UECapabilityEnquiry(uint8_t Mod_id,
(void*)&dl_dcch_msg,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -1891,7 +1891,7 @@ uint16_t do_RRCConnectionReconfiguration(uint8_t Mod
(void*)&dl_dcch_msg,
buffer,
RRC_BUF_SIZE);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#ifdef XER_PRINT
......@@ -2077,7 +2077,7 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id,
(void*)mcch_message,
buffer,
100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -2202,7 +2202,7 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
#if defined(ENABLE_ITTI)
......@@ -2295,143 +2295,169 @@ uint8_t do_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8_t
return encoded;
}
OAI_UECapability_t *fill_ue_capability(void) {
//OAI_UECapability_t *fill_ue_capability(void) {
OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname) {
static OAI_UECapability_t UECapability; /* TODO declared static to allow returning this has an address should be allocated in a cleaner way. */
SupportedBandEUTRA_t Bandlist[4];
// BandInfoEUTRA_t BandInfo_meas[4];
InterFreqBandInfo_t InterFreqBandInfo[4][4];
BandInfoEUTRA_t BandInfoEUTRA[4];
UE_EUTRA_Capability_t *UE_EUTRA_Capability;
asn_enc_rval_t enc_rval;
asn_dec_rval_t dec_rval;
long maxNumberROHC_ContextSessions = PDCP_Parameters__maxNumberROHC_ContextSessions_cs16;
int i;
Bandlist[0].bandEUTRA = 33; // 1900-1920 TDD
Bandlist[0].halfDuplex = 0;
Bandlist[1].bandEUTRA = 38; // 2570-2620 TDD
Bandlist[1].halfDuplex = 0;
Bandlist[2].bandEUTRA = 5; // 824-849 , 869-894 FDD
Bandlist[2].halfDuplex = 0;
Bandlist[3].bandEUTRA = 7; // 2500-2570, 2620-2690 FDD
Bandlist[3].halfDuplex = 0;
memset((void*)InterFreqBandInfo, 0, sizeof(InterFreqBandInfo));
memset((void*)BandInfoEUTRA, 0, sizeof(BandInfoEUTRA));
InterFreqBandInfo[0][0].interFreqNeedForGaps = 0;
InterFreqBandInfo[0][1].interFreqNeedForGaps = 1;
InterFreqBandInfo[0][2].interFreqNeedForGaps = 1;
InterFreqBandInfo[0][3].interFreqNeedForGaps = 1;
InterFreqBandInfo[1][0].interFreqNeedForGaps = 1;
InterFreqBandInfo[1][1].interFreqNeedForGaps = 0;
InterFreqBandInfo[1][2].interFreqNeedForGaps = 1;
InterFreqBandInfo[1][3].interFreqNeedForGaps = 1;
InterFreqBandInfo[2][0].interFreqNeedForGaps = 1;
InterFreqBandInfo[2][1].interFreqNeedForGaps = 1;
InterFreqBandInfo[2][2].interFreqNeedForGaps = 0;
InterFreqBandInfo[2][3].interFreqNeedForGaps = 1;
InterFreqBandInfo[3][0].interFreqNeedForGaps = 1;
InterFreqBandInfo[3][1].interFreqNeedForGaps = 1;
InterFreqBandInfo[3][2].interFreqNeedForGaps = 1;
InterFreqBandInfo[3][3].interFreqNeedForGaps = 0;
LOG_I(RRC,"Allocating %d bytes for UE_EUTRA_Capability\n",sizeof(*UE_EUTRA_Capability));
UE_EUTRA_Capability_t *UE_EUTRA_Capability;
char UE_EUTRA_Capability_xer[8192];
size_t size;
FILE *f;
LOG_I(RRC,"Allocating %u bytes for UE_EUTRA_Capability\n",sizeof(*UE_EUTRA_Capability));
UE_EUTRA_Capability = CALLOC(1, sizeof(*UE_EUTRA_Capability));
UE_EUTRA_Capability->accessStratumRelease = 0;//AccessStratumRelease_rel8;
UE_EUTRA_Capability->ue_Category = 4;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0001=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0002=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0003=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0004=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0006=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0101=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0102=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0103=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0104=0;
UE_EUTRA_Capability->pdcp_Parameters.maxNumberROHC_ContextSessions = &maxNumberROHC_ContextSessions;
UE_EUTRA_Capability->phyLayerParameters.ue_TxAntennaSelectionSupported = 0;
UE_EUTRA_Capability->phyLayerParameters.ue_SpecificRefSigsSupported = 0;
UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.count = 0;
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][3]);
// UE_EUTRA_Capability->measParameters.bandListEUTRA.list.count = 0; // no measurements on other bands
// UE_EUTRA_Capability->featureGroupIndicators // null
// UE_EUTRA_Capability->interRAT_Parameters // null
assert(UE_EUTRA_Capability);
if (!UE_EUTRA_Capability_xer_fname) {
Bandlist[0].bandEUTRA = 33; // 1900-1920 TDD
Bandlist[0].halfDuplex = 0;
Bandlist[1].bandEUTRA = 38; // 2570-2620 TDD
Bandlist[1].halfDuplex = 0;
Bandlist[2].bandEUTRA = 5; // 824-849 , 869-894 FDD
Bandlist[2].halfDuplex = 0;
Bandlist[3].bandEUTRA = 7; // 2500-2570, 2620-2690 FDD
Bandlist[3].halfDuplex = 0;
memset((void*)InterFreqBandInfo, 0, sizeof(InterFreqBandInfo));
memset((void*)BandInfoEUTRA, 0, sizeof(BandInfoEUTRA));
InterFreqBandInfo[0][0].interFreqNeedForGaps = 0;
InterFreqBandInfo[0][1].interFreqNeedForGaps = 1;
InterFreqBandInfo[0][2].interFreqNeedForGaps = 1;
InterFreqBandInfo[0][3].interFreqNeedForGaps = 1;
InterFreqBandInfo[1][0].interFreqNeedForGaps = 1;
InterFreqBandInfo[1][1].interFreqNeedForGaps = 0;
InterFreqBandInfo[1][2].interFreqNeedForGaps = 1;
InterFreqBandInfo[1][3].interFreqNeedForGaps = 1;
InterFreqBandInfo[2][0].interFreqNeedForGaps = 1;
InterFreqBandInfo[2][1].interFreqNeedForGaps = 1;
InterFreqBandInfo[2][2].interFreqNeedForGaps = 0;
InterFreqBandInfo[2][3].interFreqNeedForGaps = 1;
InterFreqBandInfo[3][0].interFreqNeedForGaps = 1;
InterFreqBandInfo[3][1].interFreqNeedForGaps = 1;
InterFreqBandInfo[3][2].interFreqNeedForGaps = 1;
InterFreqBandInfo[3][3].interFreqNeedForGaps = 0;
UE_EUTRA_Capability->accessStratumRelease = 0;//AccessStratumRelease_rel8;
UE_EUTRA_Capability->ue_Category = 4;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0001=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0002=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0003=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0004=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0006=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0101=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0102=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0103=0;
UE_EUTRA_Capability->pdcp_Parameters.supportedROHC_Profiles.profile0x0104=0;
UE_EUTRA_Capability->pdcp_Parameters.maxNumberROHC_ContextSessions = &maxNumberROHC_ContextSessions;
UE_EUTRA_Capability->phyLayerParameters.ue_TxAntennaSelectionSupported = 0;
UE_EUTRA_Capability->phyLayerParameters.ue_SpecificRefSigsSupported = 0;
UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list.count = 0;
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->rf_Parameters.supportedBandListEUTRA.list,(void*)&Bandlist[3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list,(void*)&BandInfoEUTRA[3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[0]->interFreqBandList.list,(void*)&InterFreqBandInfo[0][3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[1]->interFreqBandList.list,(void*)&InterFreqBandInfo[1][3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[2]->interFreqBandList.list,(void*)&InterFreqBandInfo[2][3]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][0]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][1]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][2]);
ASN_SEQUENCE_ADD(&UE_EUTRA_Capability->measParameters.bandListEUTRA.list.array[3]->interFreqBandList.list,(void*)&InterFreqBandInfo[3][3]);
// UE_EUTRA_Capability->measParameters.bandListEUTRA.list.count = 0; // no measurements on other bands
// UE_EUTRA_Capability->featureGroupIndicators // null
// UE_EUTRA_Capability->interRAT_Parameters // null
}
else {
f = fopen(UE_EUTRA_Capability_xer_fname, "r");
assert(f);
size = fread(UE_EUTRA_Capability_xer, 1, sizeof UE_EUTRA_Capability_xer, f);