srsLTE/srslte/include/srslte/phch/uci.h

91 lines
3.1 KiB
C
Raw Normal View History

/**
*
* \section COPYRIGHT
*
* Copyright 2013-2014 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
* it under the terms of the GNU Lesser 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
* GNU Lesser General Public License for more details.
*
* A copy of the GNU Lesser 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/.
*
*/
#ifndef UCI_
#define UCI_
#include "srslte/config.h"
#include "srslte/common/phy_common.h"
#include "srslte/phch/harq.h"
#include "srslte/fec/crc.h"
2015-03-18 11:14:24 -07:00
#define SRSLTE_UCI_MAX_CQI_LEN_PUSCH 512
#define SRSLTE_UCI_MAX_CQI_LEN_PUCCH 13
#define SRSLTE_UCI_CQI_CODED_PUCCH_B 20
typedef struct SRSLTE_API {
2015-03-18 08:05:38 -07:00
srslte_crc_t crc;
2015-03-18 11:14:24 -07:00
uint8_t tmp_cqi[SRSLTE_UCI_MAX_CQI_LEN_PUSCH];
uint8_t encoded_cqi[3*SRSLTE_UCI_MAX_CQI_LEN_PUSCH];
} srslte_uci_cqi_pusch_t;
typedef struct SRSLTE_API {
uint8_t *uci_cqi;
uint32_t uci_cqi_len;
float beta_cqi;
uint8_t uci_ri; // Only 1-bit supported for RI
uint32_t uci_ri_len;
float beta_ri;
uint8_t uci_ack; // Only 1-bit supported for HARQ
uint32_t uci_ack_len;
float beta_ack;
2015-03-18 11:14:24 -07:00
} srslte_uci_data_t;
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_uci_cqi_init(srslte_uci_cqi_pusch_t *q);
2015-03-18 11:14:24 -07:00
SRSLTE_API void srslte_uci_cqi_free(srslte_uci_cqi_pusch_t *q);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_uci_encode_cqi_pusch(srslte_uci_cqi_pusch_t *q,
uint8_t *cqi_data,
uint32_t cqi_len,
float beta,
uint32_t Q_prime_ri,
srslte_harq_t *harq_process,
uint8_t *q_bits);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_uci_encode_cqi_pucch(uint8_t *cqi_data,
uint32_t cqi_len,
uint8_t b_bits[SRSLTE_UCI_CQI_CODED_PUCCH_B]);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_uci_encode_ack(uint8_t data,
uint32_t O_cqi,
float beta,
srslte_harq_t *harq_process,
uint32_t H_prime_total,
uint8_t *q_bits);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_uci_encode_ri(uint8_t data,
uint32_t O_cqi,
float beta,
srslte_harq_t *harq_process,
uint32_t H_prime_total,
uint8_t *q_bits);
#endif