nr_rrc_config.h 5.18 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

/*! \file nr_rrc_config.c
 * \brief rrc config for gNB
 * \author Raymond Knopp, WEI-TAI CHEN
 * \date 2018
 * \version 1.0
 * \company Eurecom, NTUST
 * \email: raymond.knopp@eurecom.fr, kroempa@gmail.com
 */

31 32 33
#ifndef __NR_RRC_CONFIG_H__
#define __NR_RRC_CONFIG_H__

34 35
#include "nr_rrc_defs.h"

francescomani's avatar
francescomani committed
36 37 38 39 40 41 42 43
#define asn1cCallocOne(VaR, VaLue) \
  VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue;
#define asn1cCalloc(VaR, lOcPtr) \
  typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR));
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \
  TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \
  ASN_SEQUENCE_ADD(&VaR,lOcPtr);

francescomani's avatar
francescomani committed
44
void set_phr_config(NR_MAC_CellGroupConfig_t *mac_CellGroupConfig);
45
uint64_t get_ssb_bitmap(const NR_ServingCellConfigCommon_t *scc);
46
void rrc_coreset_config(NR_ControlResourceSet_t *coreset,
47
                        int bwp_id,
48 49
                        int curr_bwp,
                        uint64_t ssb_bitmap);
50
void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsch_TimeDomainAllocationList,
51
                          frame_type_t frame_type,
52
                          NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,
53
                          int curr_bwp);
54
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
55
void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap);
56
void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap);
57
void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time);
58
void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs);
59
void scheduling_request_config(const NR_ServingCellConfigCommon_t *scc,
60
                               NR_PUCCH_Config_t *pucch_Config);
61 62 63 64 65 66
void conig_rsrp_meas_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
                            const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
                            NR_PUCCH_CSI_Resource_t *pucchcsires,
                            int do_csi,
                            int rep_id,
                            int uid);
67
void config_csirs(const NR_ServingCellConfigCommon_t *servingcellconfigcommon,
68 69
                  NR_CSI_MeasConfig_t *csi_MeasConfig,
                  int uid,
francescomani's avatar
francescomani committed
70
                  int num_dl_antenna_ports,
71
                  int curr_bwp,
72 73
                  int do_csirs,
                  int id);
francescomani's avatar
francescomani committed
74
void config_csiim(int do_csirs, int dl_antenna_ports, int curr_bwp,
75
                  NR_CSI_MeasConfig_t *csi_MeasConfig, int id);
76
void config_srs(NR_SetupRelease_SRS_Config_t *setup_release_srs_Config,
77
                const NR_UE_NR_Capability_t *uecap,
78
                const int curr_bwp,
79
                const int uid,
francescomani's avatar
francescomani committed
80
                const int res_id,
81
                const long maxMIMO_Layers,
82
                const int do_srs);
francescomani's avatar
francescomani committed
83
struct NR_SetupRelease_PDSCH_Config *config_pdsch(uint64_t ssb_bitmap, int bwp_Id, int dl_antenna_ports);
rmagueta's avatar
rmagueta committed
84 85
void set_dl_mcs_table(int scs,
                      NR_UE_NR_Capability_t *cap,
86
                      NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
87
                      const NR_ServingCellConfigCommon_t *scc);
88 89 90 91 92
void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
                       NR_ServingCellConfigCommon_t *scc,
                       int numerology,
                       int rbsize,
                       int mcs_table);
francescomani's avatar
francescomani committed
93
struct NR_SetupRelease_PUSCH_Config *config_pusch(NR_PUSCH_Config_t *pusch_Config, const NR_ServingCellConfigCommon_t *scc);
94
void config_downlinkBWP(NR_BWP_Downlink_t *bwp,
95 96
                        const NR_ServingCellConfigCommon_t *scc,
                        const NR_ServingCellConfig_t *servingcellconfigdedicated,
97 98 99 100
                        NR_UE_NR_Capability_t *uecap,
                        int dl_antenna_ports,
                        bool force_256qam_off,
                        int bwp_loop, bool is_SA);
101 102 103
void config_uplinkBWP(NR_BWP_Uplink_t *ubwp,
                      long bwp_loop, bool is_SA, int uid,
                      const gNB_RrcConfigurationReq *configuration,
104 105
                      const NR_ServingCellConfig_t *servingcellconfigdedicated,
                      const NR_ServingCellConfigCommon_t *scc,
106
                      NR_UE_NR_Capability_t *uecap);
107

108
#endif