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

137 lines
4.6 KiB
C
Raw Normal View History

2019-04-26 12:27:38 -07:00
/*
* Copyright 2013-2019 Software Radio Systems Limited
*
2019-04-26 12:27:38 -07:00
* This file is part of srsLTE.
*
* 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
*****************************************************************************/
2018-03-31 10:04:04 -07:00
#ifndef SRSLTE_PUSCH_H
#define SRSLTE_PUSCH_H
#include "srslte/config.h"
#include "srslte/phy/ch_estimation/refsignal_ul.h"
2017-05-18 00:48:24 -07:00
#include "srslte/phy/common/phy_common.h"
#include "srslte/phy/dft/dft_precoding.h"
2017-05-18 00:48:24 -07:00
#include "srslte/phy/mimo/layermap.h"
#include "srslte/phy/mimo/precoding.h"
2017-05-18 00:48:24 -07:00
#include "srslte/phy/modem/demod_soft.h"
#include "srslte/phy/modem/mod.h"
2017-05-18 00:48:24 -07:00
#include "srslte/phy/phch/dci.h"
#include "srslte/phy/phch/pusch_cfg.h"
#include "srslte/phy/phch/regs.h"
#include "srslte/phy/phch/sch.h"
#include "srslte/phy/scrambling/scrambling.h"
typedef struct {
2019-04-23 01:53:11 -07:00
srslte_sequence_t seq[SRSLTE_NOF_SF_X_FRAME];
uint32_t cell_id;
bool sequence_generated;
2017-09-01 10:32:57 -07:00
} srslte_pusch_user_t;
/* PUSCH object */
typedef struct SRSLTE_API {
2015-03-18 05:41:50 -07:00
srslte_cell_t cell;
2019-04-23 01:53:11 -07:00
bool is_ue;
2017-09-07 04:19:53 -07:00
uint16_t ue_rnti;
uint32_t max_re;
bool llr_is_8bit;
srslte_dft_precoding_t dft_precoding;
/* buffers */
// void buffers are shared for tx and rx
cf_t* ce;
cf_t* z;
cf_t* d;
void* q;
void* g;
/* tx & rx objects */
srslte_modem_table_t mod[4];
2019-04-23 01:53:11 -07:00
srslte_sch_t ul_sch;
2016-05-09 03:38:39 -07:00
// This is to generate the scrambling seq for multiple CRNTIs
srslte_pusch_user_t** users;
srslte_sequence_t tmp_seq;
2016-05-09 03:38:39 -07:00
2019-04-23 01:53:11 -07:00
} srslte_pusch_t;
2019-04-23 01:53:11 -07:00
typedef struct SRSLTE_API {
uint8_t* ptr;
srslte_uci_value_t uci;
} srslte_pusch_data_t;
typedef struct SRSLTE_API {
uint8_t* data;
srslte_uci_value_t uci;
bool crc;
float avg_iterations_block;
} srslte_pusch_res_t;
SRSLTE_API int srslte_pusch_init_ue(srslte_pusch_t* q, uint32_t max_prb);
SRSLTE_API int srslte_pusch_init_enb(srslte_pusch_t* q, uint32_t max_prb);
SRSLTE_API void srslte_pusch_free(srslte_pusch_t* q);
2019-04-23 01:53:11 -07:00
/* These functions modify the state of the object and may take some time */
SRSLTE_API int srslte_pusch_set_cell(srslte_pusch_t* q, srslte_cell_t cell);
2019-04-23 01:53:11 -07:00
SRSLTE_API int srslte_pusch_set_rnti(srslte_pusch_t* q, uint16_t rnti);
SRSLTE_API void srslte_pusch_free_rnti(srslte_pusch_t* q, uint16_t rnti);
2016-05-09 03:38:39 -07:00
2019-04-23 01:53:11 -07:00
/* These functions do not modify the state and run in real-time */
SRSLTE_API int srslte_pusch_encode(srslte_pusch_t* q,
srslte_ul_sf_cfg_t* sf,
srslte_pusch_cfg_t* cfg,
2019-04-23 01:53:11 -07:00
srslte_pusch_data_t* data,
cf_t* sf_symbols);
2019-04-23 01:53:11 -07:00
SRSLTE_API int srslte_pusch_decode(srslte_pusch_t* q,
srslte_ul_sf_cfg_t* sf,
srslte_pusch_cfg_t* cfg,
srslte_chest_ul_res_t* channel,
cf_t* sf_symbols,
srslte_pusch_res_t* data);
SRSLTE_API uint32_t srslte_pusch_grant_tx_info(srslte_pusch_grant_t* grant,
srslte_uci_cfg_t* uci_cfg,
srslte_uci_value_t* uci_data,
char* str,
uint32_t str_len);
2019-04-23 01:53:11 -07:00
SRSLTE_API uint32_t srslte_pusch_tx_info(srslte_pusch_cfg_t* cfg,
srslte_uci_value_t* uci_data,
char* str,
uint32_t str_len);
SRSLTE_API uint32_t srslte_pusch_rx_info(srslte_pusch_cfg_t* cfg, srslte_pusch_res_t* res, char* str, uint32_t str_len);
2018-03-31 10:04:04 -07:00
#endif // SRSLTE_PUSCH_H