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
6.2 KiB
C
151 lines
6.2 KiB
C
4 years ago
|
/**
|
||
4 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
4 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
4 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.
|
||
4 years ago
|
*
|
||
|
*/
|
||
|
|
||
4 years ago
|
#ifndef SRSRAN_DCI_NR_H
|
||
|
#define SRSRAN_DCI_NR_H
|
||
4 years ago
|
|
||
4 years ago
|
#include "dci.h"
|
||
4 years ago
|
#include "srsran/phy/common/phy_common_nr.h"
|
||
|
#include "srsran/phy/phch/phch_cfg_nr.h"
|
||
4 years ago
|
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
|
srsran_dci_location_t location;
|
||
|
srsran_search_space_type_t search_space;
|
||
4 years ago
|
uint32_t coreset_id;
|
||
4 years ago
|
uint8_t payload[50];
|
||
4 years ago
|
srsran_rnti_type_t rnti_type;
|
||
4 years ago
|
uint32_t nof_bits;
|
||
4 years ago
|
srsran_dci_format_nr_t format;
|
||
4 years ago
|
uint16_t rnti;
|
||
4 years ago
|
} srsran_dci_msg_nr_t;
|
||
4 years ago
|
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
uint16_t rnti;
|
||
4 years ago
|
srsran_rnti_type_t rnti_type;
|
||
|
srsran_dci_format_nr_t format;
|
||
|
srsran_dci_location_t location;
|
||
|
srsran_search_space_type_t search_space;
|
||
4 years ago
|
uint32_t coreset_id;
|
||
4 years ago
|
|
||
|
// Common fields
|
||
|
uint32_t freq_domain_assigment; ///< Frequency domain resource assignment
|
||
|
uint32_t time_domain_assigment; ///< Time domain resource assignment
|
||
|
uint32_t vrb_to_prb_mapping; ///< VRB-to-PRB mapping
|
||
|
uint32_t mcs; ///< Modulation and coding scheme
|
||
|
uint32_t rv; ///< Redundancy version
|
||
|
uint32_t reserved; ///< Reserved bits
|
||
|
|
||
|
// C-RNTI/TC-RNTI specific fields
|
||
|
uint32_t ndi; ///< New data indicator
|
||
|
uint32_t pid; ///< HARQ process number
|
||
|
uint32_t dai; ///< Downlink assignment index
|
||
|
uint32_t tpc; ///< TPC command for scheduled PUCCH
|
||
|
uint32_t pucch_resource; ///< PUCCH resource indicator
|
||
|
uint32_t harq_feedback; ///< PDSCH-to-HARQ_feedback timing indicator
|
||
|
|
||
|
// P-RNTI specific fields
|
||
|
uint32_t smi; ///< Short Messages Indicator
|
||
|
uint32_t sm; ///< Short Messages
|
||
|
uint32_t tb_scaling; ///< TB scaling
|
||
|
|
||
|
// SI-RNTI specific fields
|
||
|
uint32_t sii; ///< System information indicator
|
||
|
|
||
4 years ago
|
} srsran_dci_dl_nr_t;
|
||
4 years ago
|
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
// Context information
|
||
|
uint16_t rnti;
|
||
4 years ago
|
srsran_rnti_type_t rnti_type;
|
||
|
srsran_dci_format_nr_t format;
|
||
|
srsran_dci_location_t location;
|
||
|
srsran_search_space_type_t search_space;
|
||
4 years ago
|
uint32_t coreset_id;
|
||
|
|
||
|
// Common fields
|
||
|
uint32_t freq_domain_assigment; ///< Frequency domain resource assignment
|
||
|
uint32_t time_domain_assigment; ///< Time domain resource assignment
|
||
|
uint32_t freq_hopping_flag; ///< Frequency hopping flag
|
||
|
uint32_t mcs; ///< Modulation and coding scheme
|
||
|
uint32_t rv; ///< Redundancy version
|
||
|
uint32_t reserved; ///< Reserved bits
|
||
|
|
||
|
// C-RNTI or CS-RNTI or MCS-C-RNTI
|
||
|
uint32_t ndi; ///< New data indicator
|
||
|
uint32_t pid; ///< HARQ process number
|
||
|
uint32_t tpc; ///< TPC command for scheduled PUCCH
|
||
|
uint32_t pucch_resource; ///< PUCCH resource indicator
|
||
|
uint32_t harq_feedback; ///< PDSCH-to-HARQ_feedback timing indicator
|
||
|
|
||
|
// Frequency hopping
|
||
|
uint32_t frequency_offset; ///< frequency offset
|
||
|
|
||
4 years ago
|
// Random Access Response Grant
|
||
|
uint32_t csi_request;
|
||
4 years ago
|
} srsran_dci_ul_nr_t;
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* @brief Indicates whether the provided DCI message format bit indicator belongs to DCI format 1_0 according according
|
||
|
* to the RNTI type. If invalid, the DCI message is likely to be format 0_0
|
||
|
* @param dci_msg Provides DCI format 1_0 message
|
||
|
* @return true if the DCI message is format 1_0, false otherwise
|
||
|
*/
|
||
4 years ago
|
SRSRAN_API bool srsran_dci_nr_format_1_0_valid(const srsran_dci_msg_nr_t* dci_msg);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_nr_pack(const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset,
|
||
|
const srsran_dci_dl_nr_t* dci,
|
||
|
srsran_dci_msg_nr_t* msg);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_nr_format_0_0_sizeof(const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset,
|
||
|
srsran_rnti_type_t rnti_type);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_nr_format_0_0_pack(const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset0,
|
||
|
const srsran_dci_ul_nr_t* dci,
|
||
|
srsran_dci_msg_nr_t* msg);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_nr_format_0_0_unpack(const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset,
|
||
|
srsran_dci_msg_nr_t* msg,
|
||
|
srsran_dci_ul_nr_t* dci);
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* @brief Unpacks DCI from Random Access Response Grant
|
||
|
* @remark Described in TS 38.213 Table 8.2-1: Random Access Response Grant Content field size
|
||
|
* @param msg
|
||
|
* @param dci
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if unpacked correctly, SRSRAN_ERROR code otherwise
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int srsran_dci_nr_rar_unpack(srsran_dci_msg_nr_t* msg, srsran_dci_ul_nr_t* dci);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_nr_format_1_0_sizeof(const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset,
|
||
|
srsran_rnti_type_t rnti_type);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_nr_format_1_0_pack(const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset,
|
||
|
const srsran_dci_dl_nr_t* dci,
|
||
|
srsran_dci_msg_nr_t* msg);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_nr_format_1_0_unpack(const srsran_carrier_nr_t* carrier,
|
||
|
const srsran_coreset_t* coreset,
|
||
|
srsran_dci_msg_nr_t* msg,
|
||
|
srsran_dci_dl_nr_t* dci);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_ul_nr_to_str(const srsran_dci_ul_nr_t* dci, char* str, uint32_t str_len);
|
||
4 years ago
|
|
||
4 years ago
|
SRSRAN_API int srsran_dci_dl_nr_to_str(const srsran_dci_dl_nr_t* dci, char* str, uint32_t str_len);
|
||
4 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_DCI_NR_H
|