srsLTE/srslte/include/srslte/phch/pusch.h

169 lines
5.5 KiB
C
Raw Normal View History

/**
*
* \section COPYRIGHT
*
2015-05-08 08:05:40 -07:00
* Copyright 2013-2015 The srsLTE Developers. See the
* COPYRIGHT file at the top-level directory of this distribution.
*
* \section LICENSE
*
* This file is part of the srsLTE library.
*
* srsLTE is free software: you can redistribute it and/or modify
2015-05-08 08:05:40 -07:00
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsLTE 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
2015-05-08 08:05:40 -07:00
* GNU Affero General Public License for more details.
*
2015-05-08 08:05:40 -07:00
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
/******************************************************************************
* File: pusch.h
*
* Description: Physical uplink shared channel.
*
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10 Sec. 5.3
*****************************************************************************/
#ifndef PUSCH_
#define PUSCH_
#include "srslte/config.h"
#include "srslte/common/phy_common.h"
#include "srslte/mimo/precoding.h"
#include "srslte/mimo/layermap.h"
#include "srslte/modem/mod.h"
#include "srslte/modem/demod_soft.h"
#include "srslte/scrambling/scrambling.h"
#include "srslte/phch/regs.h"
#include "srslte/phch/dci.h"
#include "srslte/phch/sch.h"
#include "srslte/phch/pusch_cfg.h"
2015-03-18 11:14:24 -07:00
#include "srslte/dft/dft_precoding.h"
2015-03-18 11:14:24 -07:00
#define SRSLTE_PUSCH_MAX_TDEC_ITERS 5
typedef struct {
enum {
2015-03-18 11:14:24 -07:00
SRSLTE_PUSCH_HOP_MODE_INTER_SF = 1,
SRSLTE_PUSCH_HOP_MODE_INTRA_SF = 0
} hop_mode;
uint32_t current_tx_nb;
uint32_t hopping_offset;
uint32_t n_sb;
2015-03-18 11:14:24 -07:00
} srslte_pusch_hopping_cfg_t;
2015-06-12 08:49:11 -07:00
typedef struct {
bool cs_configured;
bool ue_configured;
uint32_t cs_subf_cfg;
uint32_t cs_bw_cfg;
uint32_t ue_config_idx;
} srslte_pusch_srs_cfg_t;
/* PUSCH object */
typedef struct SRSLTE_API {
2015-03-18 05:41:50 -07:00
srslte_cell_t cell;
uint32_t max_re;
bool rnti_is_set;
uint16_t rnti;
2015-03-18 11:14:24 -07:00
srslte_dft_precoding_t dft_precoding;
2015-03-18 11:14:24 -07:00
srslte_precoding_t equalizer;
/* buffers */
// void buffers are shared for tx and rx
cf_t *ce;
2015-03-18 11:14:24 -07:00
cf_t *z;
cf_t *d;
2015-03-18 11:14:24 -07:00
void *q;
void *g;
/* tx & rx objects */
srslte_modem_table_t mod[4];
2015-03-18 11:14:24 -07:00
srslte_demod_soft_t demod;
srslte_sequence_t seq[SRSLTE_NSUBFRAMES_X_FRAME];
2015-03-18 08:05:38 -07:00
srslte_sequence_t seq_type2_fo;
2015-02-15 23:55:17 -08:00
2015-03-18 11:14:24 -07:00
srslte_sch_t dl_sch;
2015-03-18 11:14:24 -07:00
}srslte_pusch_t;
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_pusch_init(srslte_pusch_t *q,
srslte_cell_t cell);
2015-03-18 11:14:24 -07:00
SRSLTE_API void srslte_pusch_free(srslte_pusch_t *q);
SRSLTE_API int srslte_pusch_cfg(srslte_pusch_cfg_t *cfg,
srslte_cell_t cell,
srslte_dci_msg_t *dci_msg,
2015-06-12 08:49:11 -07:00
srslte_pusch_hopping_cfg_t *hopping_cfg,
srslte_pusch_srs_cfg_t *srs_cfg,
uint32_t sf_idx,
uint32_t rvidx);
2015-06-12 08:49:11 -07:00
SRSLTE_API void srslte_pusch_freq_hopping(srslte_ra_ul_grant_t *grant,
srslte_pusch_hopping_cfg_t *hopping,
uint32_t sf_idx,
uint32_t nof_prb);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_pusch_set_rnti(srslte_pusch_t *q,
uint16_t rnti);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_pusch_encode(srslte_pusch_t *q,
srslte_pusch_cfg_t *cfg,
srslte_softbuffer_tx_t *softbuffer,
2015-03-18 11:14:24 -07:00
uint8_t *data,
cf_t *sf_symbols);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_pusch_encode_rnti(srslte_pusch_t *q,
srslte_pusch_cfg_t *cfg,
srslte_softbuffer_tx_t *softbuffer,
2015-03-18 11:14:24 -07:00
uint8_t *data,
uint16_t rnti,
cf_t *sf_symbols);
2015-03-02 02:11:44 -08:00
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_pusch_uci_encode(srslte_pusch_t *q,
srslte_pusch_cfg_t *cfg,
srslte_softbuffer_tx_t *softbuffer,
2015-03-18 11:14:24 -07:00
uint8_t *data,
srslte_uci_data_t uci_data,
cf_t *sf_symbols);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_pusch_uci_encode_rnti(srslte_pusch_t *q,
srslte_pusch_cfg_t *cfg,
srslte_softbuffer_tx_t *softbuffer,
2015-03-18 11:14:24 -07:00
uint8_t *data,
srslte_uci_data_t uci_data,
uint16_t rnti,
cf_t *sf_symbols);
2015-03-02 02:11:44 -08:00
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_pusch_decode(srslte_pusch_t *q,
srslte_pusch_cfg_t *cfg,
srslte_softbuffer_rx_t *softbuffer,
2015-03-18 11:14:24 -07:00
cf_t *sf_symbols,
cf_t *ce,
float noise_estimate,
uint8_t *data);
2015-03-18 11:14:24 -07:00
SRSLTE_API float srslte_pusch_average_noi(srslte_pusch_t *q);
2015-03-18 11:14:24 -07:00
SRSLTE_API uint32_t srslte_pusch_last_noi(srslte_pusch_t *q);
#endif