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.
151 lines
5.2 KiB
C
151 lines
5.2 KiB
C
10 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
9 years ago
|
* Copyright 2013-2015 Software Radio Systems Limited
|
||
10 years ago
|
*
|
||
|
* \section LICENSE
|
||
|
*
|
||
10 years ago
|
* This file is part of the srsLTE library.
|
||
10 years ago
|
*
|
||
10 years ago
|
* srsLTE is free software: you can redistribute it and/or modify
|
||
10 years ago
|
* it under the terms of the GNU Affero General Public License as
|
||
10 years ago
|
* published by the Free Software Foundation, either version 3 of
|
||
|
* the License, or (at your option) any later version.
|
||
|
*
|
||
10 years ago
|
* srsLTE is distributed in the hope that it will be useful,
|
||
10 years ago
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
10 years ago
|
* GNU Affero General Public License for more details.
|
||
10 years ago
|
*
|
||
10 years ago
|
* A copy of the GNU Affero General Public License can be found in
|
||
10 years ago
|
* the LICENSE file in the top-level directory of this distribution
|
||
|
* and at http://www.gnu.org/licenses/.
|
||
|
*
|
||
|
*/
|
||
|
|
||
10 years ago
|
/******************************************************************************
|
||
|
* File: cqi.h
|
||
|
*
|
||
|
* Description: Channel quality indicator message packing.
|
||
|
*
|
||
|
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.2.2.6, 5.2.3.3
|
||
|
*****************************************************************************/
|
||
|
|
||
10 years ago
|
#ifndef CQI_
|
||
|
#define CQI_
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
10 years ago
|
#include "srslte/config.h"
|
||
8 years ago
|
#include "srslte/phy/common/phy_common.h"
|
||
10 years ago
|
|
||
8 years ago
|
#define SRSLTE_CQI_MAX_BITS 64
|
||
9 years ago
|
|
||
9 years ago
|
typedef struct {
|
||
9 years ago
|
bool configured;
|
||
9 years ago
|
uint32_t pmi_idx;
|
||
9 years ago
|
bool simul_cqi_ack;
|
||
|
bool format_is_subband;
|
||
|
uint32_t subband_size;
|
||
|
} srslte_cqi_periodic_cfg_t;
|
||
9 years ago
|
|
||
10 years ago
|
/* Table 5.2.2.6.2-1: Fields for channel quality information feedback for higher layer configured subband
|
||
|
CQI reports
|
||
|
(transmission mode 1, transmission mode 2, transmission mode 3, transmission mode 7 and
|
||
|
transmission mode 8 configured without PMI/RI reporting). */
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
9 years ago
|
uint8_t wideband_cqi; // 4-bit width
|
||
10 years ago
|
uint32_t subband_diff_cqi; // 2N-bit width
|
||
9 years ago
|
uint32_t N;
|
||
10 years ago
|
} srslte_cqi_hl_subband_t;
|
||
10 years ago
|
|
||
|
/* Table 5.2.2.6.3-1: Fields for channel quality information feedback for UE selected subband CQI
|
||
|
reports
|
||
|
(transmission mode 1, transmission mode 2, transmission mode 3, transmission mode 7 and
|
||
|
transmission mode 8 configured without PMI/RI reporting). */
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
9 years ago
|
uint8_t wideband_cqi; // 4-bit width
|
||
|
uint8_t subband_diff_cqi; // 2-bit width
|
||
10 years ago
|
uint32_t position_subband; // L-bit width
|
||
9 years ago
|
uint32_t L;
|
||
10 years ago
|
} srslte_cqi_ue_subband_t;
|
||
10 years ago
|
|
||
10 years ago
|
/* Table 5.2.3.3.1-1: Fields for channel quality information feedback for wideband CQI reports
|
||
|
(transmission mode 1, transmission mode 2, transmission mode 3, transmission mode 7 and
|
||
|
transmission mode 8 configured without PMI/RI reporting).
|
||
|
This is for PUCCH Format 2 reports
|
||
|
*/
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
9 years ago
|
uint8_t wideband_cqi; // 4-bit width
|
||
10 years ago
|
} srslte_cqi_format2_wideband_t;
|
||
10 years ago
|
|
||
10 years ago
|
typedef struct SRSLTE_API {
|
||
9 years ago
|
uint8_t subband_cqi; // 4-bit width
|
||
|
uint8_t subband_label; // 1- or 2-bit width
|
||
|
bool subband_label_2_bits; // false, label=1-bit, true label=2-bits
|
||
10 years ago
|
} srslte_cqi_format2_subband_t;
|
||
10 years ago
|
|
||
9 years ago
|
typedef enum {
|
||
|
SRSLTE_CQI_TYPE_WIDEBAND = 0,
|
||
|
SRSLTE_CQI_TYPE_SUBBAND,
|
||
|
SRSLTE_CQI_TYPE_SUBBAND_UE,
|
||
|
SRSLTE_CQI_TYPE_SUBBAND_HL
|
||
|
} srslte_cqi_type_t;
|
||
|
|
||
|
typedef struct {
|
||
|
union {
|
||
|
srslte_cqi_format2_wideband_t wideband;
|
||
|
srslte_cqi_format2_subband_t subband;
|
||
|
srslte_cqi_ue_subband_t subband_ue;
|
||
|
srslte_cqi_hl_subband_t subband_hl;
|
||
|
};
|
||
|
srslte_cqi_type_t type;
|
||
|
} srslte_cqi_value_t;
|
||
|
|
||
|
|
||
8 years ago
|
SRSLTE_API int srslte_cqi_size(srslte_cqi_value_t *value);
|
||
|
|
||
9 years ago
|
SRSLTE_API int srslte_cqi_value_pack(srslte_cqi_value_t *value,
|
||
|
uint8_t buff[SRSLTE_CQI_MAX_BITS]);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_cqi_hl_subband_pack(srslte_cqi_hl_subband_t *msg,
|
||
9 years ago
|
uint8_t buff[SRSLTE_CQI_MAX_BITS]);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_cqi_ue_subband_pack(srslte_cqi_ue_subband_t *msg,
|
||
9 years ago
|
uint8_t buff[SRSLTE_CQI_MAX_BITS]);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_cqi_format2_wideband_pack(srslte_cqi_format2_wideband_t *msg,
|
||
9 years ago
|
uint8_t buff[SRSLTE_CQI_MAX_BITS]);
|
||
10 years ago
|
|
||
10 years ago
|
SRSLTE_API int srslte_cqi_format2_subband_pack(srslte_cqi_format2_subband_t *msg,
|
||
9 years ago
|
uint8_t buff[SRSLTE_CQI_MAX_BITS]);
|
||
10 years ago
|
|
||
8 years ago
|
SRSLTE_API int srslte_cqi_value_unpack(uint8_t buff[SRSLTE_CQI_MAX_BITS],
|
||
|
srslte_cqi_value_t *value);
|
||
|
|
||
|
SRSLTE_API int srslte_cqi_hl_subband_unpack(uint8_t buff[SRSLTE_CQI_MAX_BITS],
|
||
|
srslte_cqi_hl_subband_t *msg);
|
||
|
|
||
|
SRSLTE_API int srslte_cqi_ue_subband_unpack(uint8_t buff[SRSLTE_CQI_MAX_BITS],
|
||
|
srslte_cqi_ue_subband_t *msg);
|
||
|
|
||
|
SRSLTE_API int srslte_cqi_format2_wideband_unpack(uint8_t buff[SRSLTE_CQI_MAX_BITS],
|
||
|
srslte_cqi_format2_wideband_t *msg);
|
||
|
|
||
|
SRSLTE_API int srslte_cqi_format2_subband_unpack(uint8_t buff[SRSLTE_CQI_MAX_BITS],
|
||
|
srslte_cqi_format2_subband_t *msg);
|
||
|
|
||
10 years ago
|
SRSLTE_API bool srslte_cqi_send(uint32_t I_cqi_pmi,
|
||
|
uint32_t tti);
|
||
|
|
||
8 years ago
|
SRSLTE_API uint8_t srslte_cqi_from_snr(float snr);
|
||
|
|
||
8 years ago
|
SRSLTE_API float srslte_cqi_to_coderate(uint32_t cqi);
|
||
|
|
||
8 years ago
|
SRSLTE_API int srslte_cqi_hl_get_subband_size(int num_prbs);
|
||
|
|
||
|
SRSLTE_API int srslte_cqi_hl_get_no_subbands(int num_prbs);
|
||
9 years ago
|
|
||
10 years ago
|
#endif // CQI_
|