mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
206 lines
7.5 KiB
C
206 lines
7.5 KiB
C
10 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
9 years ago
|
* Copyright 2013-2015 Software Radio Systems Limited
|
||
10 years ago
|
*
|
||
|
* \section LICENSE
|
||
|
*
|
||
10 years ago
|
* This file is part of the srsLTE library.
|
||
10 years ago
|
*
|
||
10 years ago
|
* srsLTE is free software: you can redistribute it and/or modify
|
||
10 years ago
|
* it under the terms of the GNU Affero General Public License as
|
||
10 years ago
|
* published by the Free Software Foundation, either version 3 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
10 years ago
|
* srsLTE is distributed in the hope that it will be useful,
|
||
10 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
10 years ago
|
* GNU Affero General Public License for more details.
|
||
10 years ago
|
*
|
||
10 years ago
|
* A copy of the GNU Affero General Public License can be found in
|
||
10 years ago
|
* the LICENSE file in the top-level directory of this distribution
|
||
|
* and at http://www.gnu.org/licenses/.
|
||
|
*
|
||
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
|
* File: ue_ul.h
|
||
|
*
|
||
|
* Description: UE uplink object.
|
||
|
*
|
||
|
* This module is a frontend to all the uplink data and control
|
||
|
* channel processing modules.
|
||
|
*
|
||
|
* Reference:
|
||
|
*****************************************************************************/
|
||
|
|
||
10 years ago
|
#ifndef UEUL_H
|
||
|
#define UEUL_H
|
||
|
|
||
8 years ago
|
#include "srslte/phy/common/phy_common.h"
|
||
|
#include "srslte/phy/ch_estimation/chest_dl.h"
|
||
|
#include "srslte/phy/dft/ofdm.h"
|
||
|
#include "srslte/phy/ch_estimation/refsignal_ul.h"
|
||
|
#include "srslte/phy/phch/pusch.h"
|
||
|
#include "srslte/phy/phch/dci.h"
|
||
|
#include "srslte/phy/phch/ra.h"
|
||
|
#include "srslte/phy/sync/cfo.h"
|
||
|
#include "srslte/phy/utils/vector.h"
|
||
|
#include "srslte/phy/utils/debug.h"
|
||
10 years ago
|
|
||
10 years ago
|
#include "srslte/config.h"
|
||
10 years ago
|
|
||
9 years ago
|
/* UE UL power control */
|
||
|
typedef struct {
|
||
|
// Common configuration
|
||
|
float p0_nominal_pusch;
|
||
|
float alpha;
|
||
|
float p0_nominal_pucch;
|
||
|
float delta_f_pucch[5];
|
||
|
float delta_preamble_msg3;
|
||
|
|
||
|
// Dedicated configuration
|
||
|
float p0_ue_pusch;
|
||
|
bool delta_mcs_based;
|
||
|
bool acc_enabled;
|
||
|
float p0_ue_pucch;
|
||
|
float p_srs_offset;
|
||
|
} srslte_ue_ul_powerctrl_t;
|
||
10 years ago
|
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
10 years ago
|
srslte_ofdm_t fft;
|
||
|
srslte_cfo_t cfo;
|
||
10 years ago
|
srslte_cell_t cell;
|
||
10 years ago
|
|
||
10 years ago
|
bool normalize_en;
|
||
10 years ago
|
bool cfo_en;
|
||
10 years ago
|
|
||
10 years ago
|
float current_cfo;
|
||
9 years ago
|
srslte_pucch_format_t last_pucch_format;
|
||
|
|
||
10 years ago
|
srslte_pusch_cfg_t pusch_cfg;
|
||
10 years ago
|
srslte_refsignal_ul_t signals;
|
||
|
srslte_refsignal_ul_dmrs_pregen_t pregen_drms;
|
||
|
srslte_refsignal_srs_pregen_t pregen_srs;
|
||
|
|
||
10 years ago
|
srslte_softbuffer_tx_t softbuffer;
|
||
|
|
||
10 years ago
|
srslte_pusch_t pusch;
|
||
10 years ago
|
srslte_pucch_t pucch;
|
||
|
|
||
10 years ago
|
srslte_pucch_sched_t pucch_sched;
|
||
|
srslte_refsignal_srs_cfg_t srs_cfg;
|
||
|
srslte_uci_cfg_t uci_cfg;
|
||
|
srslte_pusch_hopping_cfg_t hopping_cfg;
|
||
9 years ago
|
srslte_ue_ul_powerctrl_t power_ctrl;
|
||
|
|
||
10 years ago
|
cf_t *refsignal;
|
||
10 years ago
|
cf_t *srs_signal;
|
||
10 years ago
|
cf_t *sf_symbols;
|
||
|
|
||
|
uint16_t current_rnti;
|
||
10 years ago
|
bool signals_pregenerated;
|
||
10 years ago
|
}srslte_ue_ul_t;
|
||
10 years ago
|
|
||
9 years ago
|
|
||
|
|
||
10 years ago
|
/* This function shall be called just after the initial synchronization */
|
||
10 years ago
|
SRSLTE_API int srslte_ue_ul_init(srslte_ue_ul_t *q,
|
||
|
srslte_cell_t cell);
|
||
|
|
||
|
SRSLTE_API void srslte_ue_ul_free(srslte_ue_ul_t *q);
|
||
|
|
||
|
SRSLTE_API void srslte_ue_ul_set_cfo(srslte_ue_ul_t *q,
|
||
|
float cur_cfo);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_ul_set_cfo_enable(srslte_ue_ul_t *q,
|
||
|
bool enabled);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_ul_set_normalization(srslte_ue_ul_t *q,
|
||
|
bool enabled);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_ul_set_cfg(srslte_ue_ul_t *q,
|
||
|
srslte_refsignal_dmrs_pusch_cfg_t *dmrs_cfg,
|
||
10 years ago
|
srslte_refsignal_srs_cfg_t *srs_cfg,
|
||
|
srslte_pucch_cfg_t *pucch_cfg,
|
||
|
srslte_pucch_sched_t *pucch_sched,
|
||
|
srslte_uci_cfg_t *uci_cfg,
|
||
9 years ago
|
srslte_pusch_hopping_cfg_t *hopping_cfg,
|
||
|
srslte_ue_ul_powerctrl_t *power_ctrl);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_ul_cfg_grant(srslte_ue_ul_t *q,
|
||
10 years ago
|
srslte_ra_ul_grant_t *grant,
|
||
10 years ago
|
uint32_t tti,
|
||
10 years ago
|
uint32_t rvidx,
|
||
|
uint32_t current_tx_nb);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_ul_pucch_encode(srslte_ue_ul_t *q,
|
||
|
srslte_uci_data_t uci_data,
|
||
10 years ago
|
uint32_t pdcch_n_cce, /* Ncce of the last PDCCH message received */
|
||
10 years ago
|
uint32_t tti,
|
||
10 years ago
|
cf_t *output_signal);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_ul_pusch_encode(srslte_ue_ul_t *q,
|
||
|
uint8_t *data,
|
||
|
cf_t *output_signal);
|
||
|
|
||
|
SRSLTE_API int srslte_ue_ul_pusch_encode_rnti(srslte_ue_ul_t *q,
|
||
|
uint8_t *data,
|
||
|
uint16_t rnti,
|
||
|
cf_t *output_signal);
|
||
|
|
||
|
SRSLTE_API int srslte_ue_ul_pusch_uci_encode(srslte_ue_ul_t *q,
|
||
|
uint8_t *data,
|
||
|
srslte_uci_data_t uci_data,
|
||
|
cf_t *output_signal);
|
||
|
|
||
|
SRSLTE_API int srslte_ue_ul_pusch_uci_encode_rnti(srslte_ue_ul_t *q,
|
||
|
uint8_t *data,
|
||
|
srslte_uci_data_t uci_data,
|
||
|
uint16_t rnti,
|
||
|
cf_t *output_signal);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_ul_pusch_encode_rnti_softbuffer(srslte_ue_ul_t *q,
|
||
|
uint8_t *data,
|
||
|
srslte_uci_data_t uci_data,
|
||
|
srslte_softbuffer_tx_t *softbuffer,
|
||
|
uint16_t rnti,
|
||
|
cf_t *output_signal);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_ul_srs_encode(srslte_ue_ul_t *q,
|
||
|
uint32_t tti,
|
||
|
cf_t *output_signal);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_ul_reset(srslte_ue_ul_t *q);
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_ul_pregen_signals(srslte_ue_ul_t *q);
|
||
|
|
||
10 years ago
|
SRSLTE_API void srslte_ue_ul_set_rnti(srslte_ue_ul_t *q,
|
||
|
uint16_t rnti);
|
||
10 years ago
|
|
||
9 years ago
|
/* Power control procedure */
|
||
|
SRSLTE_API float srslte_ue_ul_pusch_power(srslte_ue_ul_t *q,
|
||
|
float PL,
|
||
|
float p0_preamble);
|
||
|
|
||
9 years ago
|
SRSLTE_API float srslte_ue_ul_pucch_power(srslte_ue_ul_t *q,
|
||
|
float PL,
|
||
|
srslte_pucch_format_t format,
|
||
|
uint32_t n_cqi,
|
||
|
uint32_t n_harq);
|
||
|
|
||
|
SRSLTE_API float srslte_ue_ul_srs_power(srslte_ue_ul_t *q,
|
||
|
float PL);
|
||
|
|
||
10 years ago
|
/* Other static functions for UL PHY procedures defined in 36.213 */
|
||
|
|
||
10 years ago
|
SRSLTE_API int srslte_ue_ul_sr_send_tti(uint32_t I_sr,
|
||
|
uint32_t current_tti);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API bool srslte_ue_ul_srs_tx_enabled(srslte_refsignal_srs_cfg_t *srs_cfg,
|
||
|
uint32_t tti);
|
||
|
|
||
9 years ago
|
|
||
10 years ago
|
#endif
|