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.
143 lines
6.3 KiB
C
143 lines
6.3 KiB
C
4 years ago
|
/**
|
||
10 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
10 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
10 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
10 years ago
|
*
|
||
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
|
* File: uci.h
|
||
|
*
|
||
10 years ago
|
* Description: Uplink control information. Only 1-bit ACK for UCI on PUSCCH is supported
|
||
10 years ago
|
*
|
||
|
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.2.3, 5.2.4
|
||
|
*****************************************************************************/
|
||
10 years ago
|
|
||
4 years ago
|
#ifndef SRSRAN_UCI_H
|
||
|
#define SRSRAN_UCI_H
|
||
|
|
||
|
#include "srsran/config.h"
|
||
|
#include "srsran/phy/common/phy_common.h"
|
||
|
#include "srsran/phy/fec/convolutional/viterbi.h"
|
||
|
#include "srsran/phy/fec/crc.h"
|
||
|
#include "srsran/phy/phch/pusch_cfg.h"
|
||
|
#include "srsran/phy/phch/uci_cfg.h"
|
||
|
|
||
|
#define SRSRAN_UCI_MAX_CQI_LEN_PUSCH 512
|
||
|
#define SRSRAN_UCI_MAX_CQI_LEN_PUCCH 13
|
||
|
#define SRSRAN_UCI_CQI_CODED_PUCCH_B 20
|
||
|
#define SRSRAN_UCI_STR_MAX_CHAR 32
|
||
|
|
||
|
typedef struct SRSRAN_API {
|
||
|
srsran_crc_t crc;
|
||
|
srsran_viterbi_t viterbi;
|
||
|
uint8_t tmp_cqi[SRSRAN_UCI_MAX_CQI_LEN_PUSCH];
|
||
|
uint8_t encoded_cqi[3 * SRSRAN_UCI_MAX_CQI_LEN_PUSCH];
|
||
|
int16_t encoded_cqi_s[3 * SRSRAN_UCI_MAX_CQI_LEN_PUSCH];
|
||
|
} srsran_uci_cqi_pusch_t;
|
||
|
|
||
|
typedef struct SRSRAN_API {
|
||
5 years ago
|
uint8_t** cqi_table;
|
||
|
int16_t** cqi_table_s;
|
||
4 years ago
|
} srsran_uci_cqi_pucch_t;
|
||
8 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_uci_cqi_pucch_init(srsran_uci_cqi_pucch_t* q);
|
||
8 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_uci_cqi_pucch_free(srsran_uci_cqi_pucch_t* q);
|
||
7 years ago
|
|
||
4 years ago
|
SRSRAN_API int
|
||
|
srsran_uci_encode_cqi_pucch(uint8_t* cqi_data, uint32_t cqi_len, uint8_t b_bits[SRSRAN_UCI_CQI_CODED_PUCCH_B]);
|
||
8 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_uci_encode_cqi_pucch_from_table(srsran_uci_cqi_pucch_t* q,
|
||
5 years ago
|
uint8_t* cqi_data,
|
||
|
uint32_t cqi_len,
|
||
4 years ago
|
uint8_t b_bits[SRSRAN_UCI_CQI_CODED_PUCCH_B]);
|
||
7 years ago
|
|
||
4 years ago
|
SRSRAN_API int16_t srsran_uci_decode_cqi_pucch(srsran_uci_cqi_pucch_t* q,
|
||
|
int16_t b_bits[SRSRAN_CQI_MAX_BITS], // aligned for simd
|
||
6 years ago
|
uint8_t* cqi_data,
|
||
|
uint32_t cqi_len);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_uci_cqi_init(srsran_uci_cqi_pusch_t* q);
|
||
10 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_uci_cqi_free(srsran_uci_cqi_pusch_t* q);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_uci_encode_cqi_pusch(srsran_uci_cqi_pusch_t* q,
|
||
|
srsran_pusch_cfg_t* cfg,
|
||
5 years ago
|
uint8_t* cqi_data,
|
||
|
uint32_t cqi_len,
|
||
|
float beta,
|
||
|
uint32_t Q_prime_ri,
|
||
|
uint8_t* q_bits);
|
||
|
|
||
4 years ago
|
SRSRAN_API int srsran_uci_decode_cqi_pusch(srsran_uci_cqi_pusch_t* q,
|
||
|
srsran_pusch_cfg_t* cfg,
|
||
5 years ago
|
int16_t* q_bits,
|
||
|
float beta,
|
||
|
uint32_t Q_prime_ri,
|
||
|
uint32_t cqi_len,
|
||
|
uint8_t* cqi_data,
|
||
|
bool* cqi_ack);
|
||
6 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_uci_encode_ack(srsran_pusch_cfg_t* cfg,
|
||
6 years ago
|
uint8_t acks[2],
|
||
|
uint32_t nof_acks,
|
||
|
uint32_t O_cqi,
|
||
|
float beta,
|
||
|
uint32_t H_prime_total,
|
||
4 years ago
|
srsran_uci_bit_t* ri_bits);
|
||
6 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_uci_encode_ack_ri(srsran_pusch_cfg_t* cfg,
|
||
6 years ago
|
uint8_t* data,
|
||
|
uint32_t O_ack,
|
||
|
uint32_t O_cqi,
|
||
|
float beta,
|
||
|
uint32_t H_prime_total,
|
||
|
bool input_is_ri,
|
||
|
uint32_t N_bundle,
|
||
4 years ago
|
srsran_uci_bit_t* ri_bits);
|
||
6 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_uci_decode_ack_ri(srsran_pusch_cfg_t* cfg,
|
||
6 years ago
|
int16_t* q_bits,
|
||
|
uint8_t* c_seq,
|
||
|
float beta,
|
||
|
uint32_t H_prime_total,
|
||
|
uint32_t O_cqi,
|
||
4 years ago
|
srsran_uci_bit_t* ack_ri_bits,
|
||
5 years ago
|
uint8_t* data,
|
||
4 years ago
|
bool* valid,
|
||
6 years ago
|
uint32_t nof_bits,
|
||
|
bool is_ri);
|
||
|
|
||
4 years ago
|
/**
|
||
|
* Calculates the maximum number of coded symbols used by CQI-UCI over PUSCH
|
||
|
*/
|
||
4 years ago
|
SRSRAN_API uint32_t srsran_qprime_cqi_ext(uint32_t L_prb, uint32_t nof_symbols, uint32_t tbs, float beta);
|
||
4 years ago
|
|
||
|
/**
|
||
|
* Calculates the maximum number of coded symbols used by ACK/RI over PUSCH
|
||
|
*/
|
||
4 years ago
|
SRSRAN_API uint32_t
|
||
|
srsran_qprime_ack_ext(uint32_t L_prb, uint32_t nof_symbols, uint32_t tbs, uint32_t nof_ack, float beta);
|
||
4 years ago
|
|
||
5 years ago
|
/**
|
||
|
* Calculates the number of acknowledgements carried by the Uplink Control Information (UCI) deduced from the number of
|
||
|
* transport blocks indicated in the UCI's configuration.
|
||
|
*
|
||
|
* @param uci_cfg is the UCI configuration
|
||
|
* @return the number of acknowledgements
|
||
|
*/
|
||
4 years ago
|
SRSRAN_API uint32_t srsran_uci_cfg_total_ack(const srsran_uci_cfg_t* uci_cfg);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API void srsran_uci_data_reset(srsran_uci_data_t* uci_data);
|
||
5 years ago
|
|
||
4 years ago
|
SRSRAN_API int
|
||
|
srsran_uci_data_info(srsran_uci_cfg_t* uci_cfg, srsran_uci_value_t* uci_data, char* str, uint32_t maxlen);
|
||
10 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_UCI_H
|