2015-01-29 16:15:09 -08:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* \section COPYRIGHT
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* Copyright 2013-2014 The srsLTE Developers. See the
|
2015-01-29 16:15:09 -08:00
|
|
|
* COPYRIGHT file at the top-level directory of this distribution.
|
|
|
|
*
|
|
|
|
* \section LICENSE
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* This file is part of the srsLTE library.
|
2015-01-29 16:15:09 -08:00
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* srsLTE is free software: you can redistribute it and/or modify
|
2015-01-29 16:15:09 -08:00
|
|
|
* 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.
|
|
|
|
*
|
2015-03-18 05:31:13 -07:00
|
|
|
* srsLTE is distributed in the hope that it will be useful,
|
2015-01-29 16:15:09 -08:00
|
|
|
* 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_
|
|
|
|
|
2015-03-18 05:16:28 -07:00
|
|
|
#include "srslte/config.h"
|
2015-03-18 05:31:13 -07:00
|
|
|
#include "srslte/common/phy_common.h"
|
|
|
|
#include "srslte/phch/harq.h"
|
|
|
|
#include "srslte/fec/crc.h"
|
2015-02-09 02:32:47 -08:00
|
|
|
|
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
|
2015-02-13 01:02:10 -08:00
|
|
|
|
2015-02-09 02:32:47 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
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;
|
2015-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 05:31:13 -07:00
|
|
|
typedef struct SRSLTE_API {
|
2015-01-29 16:15:09 -08:00
|
|
|
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-01-29 16:15:09 -08:00
|
|
|
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_API int srslte_uci_cqi_init(srslte_uci_cqi_pusch_t *q);
|
2015-02-09 02:32:47 -08:00
|
|
|
|
2015-03-18 11:14:24 -07:00
|
|
|
SRSLTE_API void srslte_uci_cqi_free(srslte_uci_cqi_pusch_t *q);
|
2015-01-29 16:15:09 -08:00
|
|
|
|
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-02-13 01:02:10 -08:00
|
|
|
|
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-01-29 16:15:09 -08:00
|
|
|
|
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-02-12 04:22:17 -08:00
|
|
|
|
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);
|
2015-02-12 04:22:17 -08:00
|
|
|
|
2015-01-29 16:15:09 -08:00
|
|
|
|
|
|
|
#endif
|