Commit 7a704567 authored by Matthieu Kanj's avatar Matthieu Kanj

removing warnings (115 remaining) +

creation of two new files: openair1/PHY/LTE_ESTIMATION/defs_NB_IoT.h
openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_NB_IoT.c
parent 2a792c1c
......@@ -1039,6 +1039,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_time.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_sync_timefreq.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_adjust_sync_NB_IoT.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c
......
/*
* 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 __LTE_ESTIMATION_DEFS_NB_IOT__H__
#define __LTE_ESTIMATION_DEFS_NB_IOT__H__
#include "PHY/defs_NB_IoT.h"
/*
int lte_est_timing_advance(NB_IoT_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_SRS *lte_eNb_srs,
unsigned int *eNb_id,
unsigned char clear,
unsigned char number_of_cards,
short coef);
*/
int NB_IoT_est_timing_advance_pusch(PHY_VARS_eNB_NB_IoT* phy_vars_eNB,module_id_t UE_id);
/** @} */
#endif
/*
* 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
*/
//#include "PHY/types.h"
#include "PHY/defs_NB_IoT.h"
//#include "PHY/extern.h"
//#include "UTIL/LOG/vcd_signal_dumper.h"
#define DEBUG_PHY
int NB_IoT_est_timing_advance_pusch(PHY_VARS_eNB_NB_IoT* eNB,uint8_t UE_id)
{
static int first_run=1;
static int max_pos_fil2=0;
int temp, i, aa, max_pos=0, max_val=0;
short Re,Im,coef=24576;
short ncoef = 32768 - coef;
NB_IoT_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
NB_IoT_eNB_PUSCH *eNB_pusch_vars = eNB->pusch_vars[UE_id];
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[0];
uint8_t cyclic_shift = 0;
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
for (i = 0; i < frame_parms->ofdm_symbol_size; i++) {
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)ul_ch_estimates_time[aa])[(i<<1)];
Im = ((int16_t*)ul_ch_estimates_time[aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
if (temp > max_val) {
max_pos = i;
max_val = temp;
}
}
if (max_pos>frame_parms->ofdm_symbol_size/2)
max_pos = max_pos-frame_parms->ofdm_symbol_size;
// filter position to reduce jitter
if (first_run == 1) {
first_run=0;
max_pos_fil2 = max_pos;
} else
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
#ifdef DEBUG_PHY
LOG_D(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",eNB->proc.frame_rx,max_pos,max_pos_fil2,sync_pos);
#endif //DEBUG_PHY
return(max_pos_fil2-sync_pos);
}
......@@ -1263,7 +1263,7 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
int32_t IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2];
int32_t IP_allavg[D_NPUCCH_SF5];
//int16_t temp_ch[2];
int16_t m[NUMBER_OF_UE_MAX], m_self, same_m_number;
int16_t m[NUMBER_OF_UE_MAX], m_self=0, same_m_number;
uint16_t n3_pucch_sameRB[NUMBER_OF_UE_MAX];
int16_t n_oc0[NUMBER_OF_UE_MAX];
int16_t n_oc1[NUMBER_OF_UE_MAX];
......
......@@ -201,6 +201,7 @@ typedef struct {
uint8_t srsUeSubframe;
} SOUNDINGRS_UL_CONFIG_DEDICATED_NB_IoT;
/// Enumeration for parameter SR transmission \ref SCHEDULING_REQUEST_CONFIG::dsr_TransMax.
typedef enum {
//sr_n4=0,
......
......@@ -140,10 +140,10 @@ typedef struct rlc_am_entity_s {
//----------------------------------------------------
//DL-AM-RLC Config NB-IoT parameter
uint32_t* enableStatusReportSN_Gap;
uint32_t *enableStatusReportSN_Gap_NB_IoT;
//UL-AM-RLC Config. NB-IoT parameter
uint16_t max_retx_threshold_NB;
rlc_am_timer_t t_poll_retransmit_NB; //TIMER
uint16_t max_retx_threshold_NB_IoT;
rlc_am_timer_t t_poll_retransmit_NB_IoT; //TIMER
//---------------------------------------------------------------------
// STATISTICS
......
......@@ -72,11 +72,11 @@ typedef volatile struct {
typedef volatile struct {
//UL-AM-RLC Configurations
uint16_t max_retx_threshold_NB;
uint32_t t_poll_retransmit_NB;
uint16_t max_retx_threshold_NB_IoT;
uint32_t t_poll_retransmit_NB_IoT;
//DL-AM-RLC Configurations
uint32_t* enableStatusReportSN_Gap; /*OPTIONAL*/
}rlc_am_info_NB_t;
uint32_t* enableStatusReportSN_Gap_NB_IoT; /*OPTIONAL*/
}rlc_am_info_NB_IoT_t;
//-----------------------------------------------------------------------------
/*! \fn void rlc_am_init (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP)
......
......@@ -137,7 +137,7 @@ typedef volatile struct {
rlc_mode_t rlc_mode;
union {
rlc_am_info_t rlc_am_info; /*!< \sa rlc_am.h. */
rlc_am_info_NB_t rlc_am_info_NB; //integrate NB-IoT
rlc_am_info_NB_IoT_t rlc_am_info_NB_IoT; //integrate NB-IoT
rlc_tm_info_t rlc_tm_info; /*!< \sa rlc_tm.h. */
rlc_um_info_t rlc_um_info; /*!< \sa rlc_um.h. */
} rlc;
......
......@@ -2815,7 +2815,7 @@ void config_req_rlc_am_asn1_NB_IoT (
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
pollRetransmit_NB_tab[config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13]);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold_NB = %d t_poll_retransmit_NB = %d \n",
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold_NB_IoT = %d t_poll_retransmit_NB_IoT = %d \n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
maxRetxThreshold_NB_tab[config_am_pP->ul_AM_RLC_r13.maxRetxThreshold_r13],
pollRetransmit_NB_tab[config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13]);
......@@ -2839,7 +2839,7 @@ void config_req_rlc_am_asn1_NB_IoT (
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p));
LOG_D(RLC,
PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold_NB=%ld t_poll_retransmit_NB=%ld), RLC-AM NOT CONFIGURED\n",
PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold_NB_IoT=%ld t_poll_retransmit_NB_IoT=%ld), RLC-AM NOT CONFIGURED\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
config_am_pP->ul_AM_RLC_r13.maxRetxThreshold_r13,
config_am_pP->ul_AM_RLC_r13.t_PollRetransmit_r13);
......@@ -2853,15 +2853,15 @@ void config_req_rlc_am_asn1_NB_IoT (
//defined in rlc_am_init.c
//-----------------------------------------------------------------------------
void rlc_am_configure_NB_IoT(
const protocol_ctxt_t* const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
const protocol_ctxt_t *const ctxt_pP,
rlc_am_entity_t *const rlc_pP,
const uint16_t max_retx_thresholdP,
const uint16_t t_poll_retransmitP,
const uint32_t* enableStatusReportSN_Gap
uint32_t *enableStatusReportSN_Gap
)
{
if (rlc_pP->configured == TRUE) {
LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RECONFIGURE] max_retx_threshold_NB %d t_poll_retransmit_NB %d\n",
LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RECONFIGURE] max_retx_threshold_NB_IoT %d t_poll_retransmit_NB_IoT %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
max_retx_thresholdP,
t_poll_retransmitP
......@@ -2869,23 +2869,23 @@ void rlc_am_configure_NB_IoT(
//FIXME: rlc_am_entity_t should be modified??
rlc_pP->max_retx_threshold_NB = max_retx_thresholdP;
rlc_pP->max_retx_threshold_NB_IoT = max_retx_thresholdP;
rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_pP->t_poll_retransmit_NB.ms_duration = t_poll_retransmitP;
rlc_pP->enableStatusReportSN_Gap = enableStatusReportSN_Gap;
rlc_pP->t_poll_retransmit_NB_IoT.ms_duration = t_poll_retransmitP;
rlc_pP->enableStatusReportSN_Gap_NB_IoT = enableStatusReportSN_Gap;
} else {
LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[CONFIGURE] max_retx_threshold_NB %d t_poll_retransmit_NB %d\n",
LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[CONFIGURE] max_retx_threshold_NB_IoT %d t_poll_retransmit_NB_IoT %d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
max_retx_thresholdP,
t_poll_retransmitP
//enableStatusReportSN_Gap
);
rlc_pP->max_retx_threshold_NB = max_retx_thresholdP;
rlc_pP->max_retx_threshold_NB_IoT = max_retx_thresholdP;
rlc_pP->protocol_state = RLC_DATA_TRANSFER_READY_STATE;
rlc_pP->enableStatusReportSN_Gap = enableStatusReportSN_Gap;
rlc_pP->enableStatusReportSN_Gap_NB_IoT = enableStatusReportSN_Gap;
rlc_am_init_timer_poll_retransmit(ctxt_pP, rlc_pP, t_poll_retransmitP);
......@@ -3070,9 +3070,9 @@ rlc_op_status_t rrc_rlc_remove_rlc_NB_IoT (
//defined in rlc_am.c
//-----------------------------------------------------------------------------
void config_req_rlc_am_NB_IoT (
const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
rlc_am_info_NB_t * const config_am_pP, //XXX: MP: rlc_am_init.c --> this structure has been modified for NB-IoT
rlc_am_info_NB_IoT_t *const config_am_pP, //XXX: MP: rlc_am_init.c --> this structure has been modified for NB-IoT
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP
)
......@@ -3089,17 +3089,17 @@ void config_req_rlc_am_NB_IoT (
LOG_D(RLC,
PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold=%d t_poll_retransmit=%d)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
config_am_pP->max_retx_threshold_NB,
config_am_pP->t_poll_retransmit_NB
config_am_pP->max_retx_threshold_NB_IoT,
config_am_pP->t_poll_retransmit_NB_IoT
//enableStatusReportSN_Gap_r13
);
rlc_am_init(ctxt_pP, l_rlc_p);
rlc_am_set_debug_infos(ctxt_pP, l_rlc_p, srb_flagP, rb_idP, chan_idP);
rlc_am_configure_NB_IoT(ctxt_pP,
l_rlc_p,
config_am_pP->max_retx_threshold_NB,
config_am_pP->t_poll_retransmit_NB,
config_am_pP->enableStatusReportSN_Gap);
config_am_pP->max_retx_threshold_NB_IoT,
config_am_pP->t_poll_retransmit_NB_IoT,
config_am_pP->enableStatusReportSN_Gap_NB_IoT);
} else {
LOG_E(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ RLC NOT FOUND\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p));
......@@ -3109,11 +3109,11 @@ void config_req_rlc_am_NB_IoT (
//defined in rlc_rrc.c
//used only for rrc_t310_expiration --> I don't know if it is used (probably not)
rlc_op_status_t rrc_rlc_config_req_NB_IoT (
const protocol_ctxt_t* const ctxt_pP,
const srb_flag_t srb_flagP,
const config_action_t actionP,
const rb_id_t rb_idP,
const rlc_info_t rlc_infoP)
const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const config_action_t actionP,
const rb_id_t rb_idP,
rlc_info_t rlc_infoP)
{
//-----------------------------------------------------------------------------
//rlc_op_status_t status;
......@@ -3148,7 +3148,7 @@ rlc_op_status_t rrc_rlc_config_req_NB_IoT (
config_req_rlc_am_NB_IoT(
ctxt_pP,
srb_flagP,
&rlc_infoP.rlc.rlc_am_info_NB, //MP: pass the volatile structure for NB_IoT protocol params in rlc_am_init.h // warning present
&rlc_infoP.rlc.rlc_am_info_NB_IoT, //MP: pass the volatile structure for NB_IoT protocol params in rlc_am_init.h // warning present
rb_idP, rb_idP);
break;
......
......@@ -314,7 +314,7 @@ void rlc_am_configure_NB_IoT(
rlc_am_entity_t *const rlc_pP,
const uint16_t max_retx_thresholdP,
const uint16_t t_poll_retransmitP,
const uint32_t* const enableStatusReportSN_Gap
uint32_t *enableStatusReportSN_Gap
);
//--------------------------------------------------------------
......@@ -343,16 +343,16 @@ rlc_op_status_t rrc_rlc_config_req_NB_IoT (
const srb_flag_t srb_flagP,
const config_action_t actionP,
const rb_id_t rb_idP,
const rlc_info_t rlc_infoP);
rlc_info_t rlc_infoP);
//-----------------------------------------------------
//defined in rlc_am.c
//------------------------------------------------------
void config_req_rlc_am_NB_IoT (
const protocol_ctxt_t* const ctxt_pP,
const protocol_ctxt_t * const ctxt_pP,
const srb_flag_t srb_flagP,
rlc_am_info_NB_t * const config_am_pP, //XXX: MP: rlc_am_init.c --> this structure has been modified for NB-IoT
rlc_am_info_NB_IoT_t *const config_am_pP, //XXX: MP: rlc_am_init.c --> this structure has been modified for NB-IoT
const rb_id_t rb_idP,
const logical_chan_id_t chan_idP
);
......
......@@ -164,9 +164,9 @@ int rrc_init_global_param_NB_IoT( void )
//Setting of this values????
Rlc_info_am_config_NB_IoT.rlc_mode = RLC_MODE_AM; //only allowed for NB-IoT
Rlc_info_am_config_NB_IoT.rlc.rlc_am_info_NB.max_retx_threshold_NB = 50;
Rlc_info_am_config_NB_IoT.rlc.rlc_am_info_NB.t_poll_retransmit_NB = 15;
Rlc_info_am_config_NB_IoT.rlc.rlc_am_info_NB.enableStatusReportSN_Gap = NULL; //should be disabled
Rlc_info_am_config_NB_IoT.rlc.rlc_am_info_NB_IoT.max_retx_threshold_NB_IoT = 50;
Rlc_info_am_config_NB_IoT.rlc.rlc_am_info_NB_IoT.t_poll_retransmit_NB_IoT = 15;
Rlc_info_am_config_NB_IoT.rlc.rlc_am_info_NB_IoT.enableStatusReportSN_Gap_NB_IoT = NULL; //should be disabled
#ifndef NO_RRM
......
......@@ -587,10 +587,10 @@ static inline int NB_rxtx(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc,
//Allocate memory for the structures used by PHY and MAC
UL_IND_t *UL_INFO;
Sched_Rsp_t *Sched_Rsp;
Sched_Rsp_t *Sched_Rsp;
UL_INFO = (UL_IND_t*) malloc(sizeof(UL_IND_t));
Sched_Rsp = (Sched_Rsp_t*) malloc(sizeof(Sched_Rsp_t));
Sched_Rsp = (Sched_Rsp_t*) malloc(sizeof(Sched_Rsp_t));
start_meas(&softmodem_stats_rxtx_sf);
......
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