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.
178 lines
6.3 KiB
C
178 lines
6.3 KiB
C
4 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
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
|
#ifndef SRSRAN_PUCCH_CFG_NR_H
|
||
|
#define SRSRAN_PUCCH_CFG_NR_H
|
||
4 years ago
|
|
||
4 years ago
|
#include "srsran/config.h"
|
||
4 years ago
|
#include <stdbool.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
4 years ago
|
/**
|
||
|
* NR-PUCCH Format 0 ranges
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_NR_FORMAT0_MAX_CS 11
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT0_MIN_NSYMB 1
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT0_MAX_NSYMB 2
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT0_MAX_STARTSYMB 13
|
||
4 years ago
|
|
||
|
/**
|
||
|
* NR-PUCCH Format 1 ranges
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_NR_FORMAT1_MAX_CS 11
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT1_MAX_TOCC 6
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT1_MIN_NSYMB 4
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT1_MAX_NSYMB 14
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT1_MAX_STARTSYMB 10
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT1_MAX_NOF_BITS 2
|
||
4 years ago
|
|
||
|
/**
|
||
|
* NR-PUCCH Format 2 ranges
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_NR_FORMAT2_MIN_NPRB 1
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT2_MAX_NPRB 16
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT2_MIN_NSYMB 1
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT2_MAX_NSYMB 2
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT2_MAX_STARTSYMB 13
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT2_MIN_NOF_BITS 3
|
||
4 years ago
|
|
||
|
/**
|
||
|
* NR-PUCCH Format 3 ranges
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_NR_FORMAT3_MIN_NPRB 1
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT3_MAX_NPRB 16
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT3_MIN_NSYMB 4
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT3_MAX_NSYMB 14
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT3_MAX_STARTSYMB 10
|
||
4 years ago
|
|
||
|
/**
|
||
|
* NR-PUCCH Format 4 ranges
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_NR_FORMAT4_NPRB 1
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT4_MIN_NSYMB 4
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT4_MAX_NSYMB 14
|
||
|
#define SRSRAN_PUCCH_NR_FORMAT4_MAX_STARTSYMB 10
|
||
4 years ago
|
|
||
|
/**
|
||
|
* NR-PUCCH Formats 2, 3 and 4 code rate range
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_NR_MAX_CODE_RATE 7
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* Maximum number of NR-PUCCH resources per set (TS 38.331 maxNrofPUCCH-ResourcesPerSet)
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_NR_MAX_NOF_RESOURCES_PER_SET 32
|
||
4 years ago
|
|
||
|
/**
|
||
|
* Maximum number NR-PUCCH resource sets (TS 38.331 maxNrofPUCCH-ResourceSets)
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_NR_MAX_NOF_SETS 4
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* Maximum number of SR resources (TS 38.331 maxNrofSR-Resources)
|
||
|
*/
|
||
4 years ago
|
#define SRSRAN_PUCCH_MAX_NOF_SR_RESOURCES 8
|
||
|
|
||
|
typedef enum SRSRAN_API {
|
||
|
SRSRAN_PUCCH_NR_FORMAT_0 = 0,
|
||
|
SRSRAN_PUCCH_NR_FORMAT_1,
|
||
|
SRSRAN_PUCCH_NR_FORMAT_2,
|
||
|
SRSRAN_PUCCH_NR_FORMAT_3,
|
||
|
SRSRAN_PUCCH_NR_FORMAT_4,
|
||
|
SRSRAN_PUCCH_NR_FORMAT_ERROR,
|
||
|
} srsran_pucch_nr_format_t;
|
||
|
|
||
|
typedef enum SRSRAN_API {
|
||
|
SRSRAN_PUCCH_NR_GROUP_HOPPING_NEITHER = 0,
|
||
|
SRSRAN_PUCCH_NR_GROUP_HOPPING_ENABLE,
|
||
|
SRSRAN_PUCCH_NR_GROUP_HOPPING_DISABLE
|
||
|
} srsran_pucch_nr_group_hopping_t;
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief PUCCH Common configuration
|
||
|
* @remark Defined in TS 38.331 PUCCH-ConfigCommon
|
||
|
*/
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
uint32_t resource_common; ///< Configures a set of cell-specific PUCCH resources/parameters
|
||
4 years ago
|
srsran_pucch_nr_group_hopping_t group_hopping; ///< Configuration of group and sequence hopping
|
||
4 years ago
|
uint32_t hopping_id; ///< Cell-specific scrambling ID for group hopping and sequence hopping if enabled
|
||
|
bool hopping_id_present;
|
||
|
float p0_nominal; ///< Power control parameter P0 for PUCCH transmissions. Value in dBm. (-202..24)
|
||
4 years ago
|
|
||
|
// From PUSCH-config
|
||
|
bool scrambling_id_present;
|
||
|
uint32_t scambling_id; // Identifier used to initialize data scrambling (dataScramblingIdentityPUSCH, 0-1023)
|
||
4 years ago
|
} srsran_pucch_nr_common_cfg_t;
|
||
4 years ago
|
|
||
|
/**
|
||
|
* @brief Generic PUCCH Resource configuration
|
||
|
* @remark Defined in TS 38.331 PUCCH-Config
|
||
|
*/
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
// Common PUCCH-Resource parameter
|
||
4 years ago
|
uint32_t starting_prb;
|
||
|
bool intra_slot_hopping;
|
||
|
uint32_t second_hop_prb;
|
||
|
|
||
|
// Common PUCCH-Resource parameters among all formats
|
||
4 years ago
|
srsran_pucch_nr_format_t format; ///< PUCCH format this configuration belongs
|
||
4 years ago
|
uint32_t nof_symbols; ///< Number of symbols
|
||
|
uint32_t start_symbol_idx; ///< Starting symbol index
|
||
|
|
||
|
// Specific PUCCH-Resource
|
||
|
uint32_t initial_cyclic_shift; ///< Used by formats 0, 1
|
||
|
uint32_t time_domain_occ; ///< Used by format 1
|
||
|
uint32_t nof_prb; ///< Used by formats 2, 3
|
||
4 years ago
|
uint32_t occ_lenth; ///< Spreading factor, used by format 4 (2, 4). Also called N_PUCCH4_SF
|
||
4 years ago
|
uint32_t occ_index; ///< Used by format 4
|
||
|
|
||
4 years ago
|
// PUCCH Format common parameters
|
||
|
bool enable_pi_bpsk; ///< Enables PI-BPSK
|
||
|
uint32_t max_code_rate; ///< Maximum code rate r (0..7)
|
||
|
bool additional_dmrs; ///< UE enables 2 DMRS symbols per hop of a PUCCH Format 3 or 4
|
||
4 years ago
|
} srsran_pucch_nr_resource_t;
|
||
4 years ago
|
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
|
srsran_pucch_nr_resource_t resources[SRSRAN_PUCCH_NR_MAX_NOF_RESOURCES_PER_SET];
|
||
4 years ago
|
uint32_t nof_resources; ///< Set to 0 if it is NOT provided by higher layers
|
||
|
uint32_t max_payload_size; ///< Maximum payload size, set to 0 if not present
|
||
4 years ago
|
} srsran_pucch_nr_resource_set_t;
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
|
* @brief Scheduling Request resource described in TS 38.331 SchedulingRequestResourceConfig
|
||
|
* @note Every SR configuration corresponds to one or more logical channels (resources)
|
||
|
*/
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
4 years ago
|
uint32_t sr_id; ///< Scheduling Request identifier
|
||
|
uint32_t period; ///< Period in slots
|
||
|
uint32_t offset; ///< Offset from beginning of the period in slots
|
||
4 years ago
|
srsran_pucch_nr_resource_t resource; ///< PUCCH resource
|
||
4 years ago
|
bool configured; ///< Set to true if higher layers added this value, otherwise set to false
|
||
4 years ago
|
} srsran_pucch_nr_sr_resource_t;
|
||
4 years ago
|
|
||
4 years ago
|
typedef struct SRSRAN_API {
|
||
|
srsran_pucch_nr_common_cfg_t common; ///< NR-PUCCH configuration common for all formats and resources
|
||
|
srsran_pucch_nr_resource_set_t sets[SRSRAN_PUCCH_NR_MAX_NOF_SETS]; ///< Resource sets, indexed by pucch-ResourceSetId
|
||
4 years ago
|
bool enabled; ///< Set to true if any set is enabled
|
||
4 years ago
|
srsran_pucch_nr_sr_resource_t
|
||
|
sr_resources[SRSRAN_PUCCH_MAX_NOF_SR_RESOURCES]; ///< SR resources, indexed by identifier
|
||
|
} srsran_pucch_nr_hl_cfg_t;
|
||
4 years ago
|
|
||
4 years ago
|
/**
|
||
4 years ago
|
* @brief Validates an NR-PUCCH resource configuration provided by upper layers
|
||
4 years ago
|
* @param resource Resource configuration to validate
|
||
4 years ago
|
* @return SRSRAN_SUCCESS if valid, SRSRAN_ERROR code otherwise
|
||
4 years ago
|
*/
|
||
4 years ago
|
SRSRAN_API int srsran_pucch_nr_cfg_resource_valid(const srsran_pucch_nr_resource_t* resource);
|
||
4 years ago
|
|
||
4 years ago
|
#endif // SRSRAN_PUCCH_CFG_NR_H
|