rrc_messages_types.h 15.4 KB
Newer Older
1 2 3 4 5
/*
 * 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
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20
 * 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
 */
21

22 23 24 25
/*
 * rrc_messages_types.h
 *
 *  Created on: Oct 24, 2013
26
 *      Author: winckel and Navid Nikaein
27 28 29 30 31
 */

#ifndef RRC_MESSAGES_TYPES_H_
#define RRC_MESSAGES_TYPES_H_

winckel's avatar
winckel committed
32
#include "as_message.h"
33
#include "rrc_types.h"
34
#include "s1ap_messages_types.h"
35
#ifdef CMAKER
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
36
  #include "LTE_SystemInformationBlockType2.h"
37
#else
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
38
  #include "RRC/LTE/MESSAGES/LTE_SystemInformationBlockType2.h"
39
#endif
40 41 42 43 44
#include "LTE_SL-OffsetIndicator-r12.h"
#include "LTE_SubframeBitmapSL-r12.h"
#include "LTE_SL-CP-Len-r12.h"
#include "LTE_SL-PeriodComm-r12.h"
#include "LTE_SL-DiscResourcePool-r12.h"
45

winckel's avatar
winckel committed
46 47 48

//-------------------------------------------------------------------------------------------//
// Messages for RRC logging
49
#if defined(DISABLE_ITTI_XER_PRINT)
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
50 51 52 53 54 55
  #include "LTE_BCCH-DL-SCH-Message.h"
  #include "LTE_DL-CCCH-Message.h"
  #include "LTE_DL-DCCH-Message.h"
  #include "LTE_UE-EUTRA-Capability.h"
  #include "LTE_UL-CCCH-Message.h"
  #include "LTE_UL-DCCH-Message.h"
56

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
57 58 59 60 61 62
  typedef BCCH_DL_SCH_Message_t   RrcDlBcchMessage;
  typedef DL_CCCH_Message_t       RrcDlCcchMessage;
  typedef DL_DCCH_Message_t       RrcDlDcchMessage;
  typedef UE_EUTRA_Capability_t   RrcUeEutraCapability;
  typedef UL_CCCH_Message_t       RrcUlCcchMessage;
  typedef UL_DCCH_Message_t       RrcUlDcchMessage;
63
#endif
64 65

//-------------------------------------------------------------------------------------------//
winckel's avatar
winckel committed
66
// Defines to access message fields.
67 68
#define RRC_STATE_IND(mSGpTR)           (mSGpTR)->ittiMsg.rrc_state_ind

69
#define RRC_CONFIGURATION_REQ(mSGpTR)   (mSGpTR)->ittiMsg.rrc_configuration_req
70

oai's avatar
oai committed
71 72
#define NBIOTRRC_CONFIGURATION_REQ(mSGpTR)   (mSGpTR)->ittiMsg.nbiotrrc_configuration_req

73
#define NAS_KENB_REFRESH_REQ(mSGpTR)    (mSGpTR)->ittiMsg.nas_kenb_refresh_req
74 75 76
#define NAS_CELL_SELECTION_REQ(mSGpTR)  (mSGpTR)->ittiMsg.nas_cell_selection_req
#define NAS_CONN_ESTABLI_REQ(mSGpTR)    (mSGpTR)->ittiMsg.nas_conn_establi_req
#define NAS_UPLINK_DATA_REQ(mSGpTR)     (mSGpTR)->ittiMsg.nas_ul_data_req
77

78 79 80 81 82 83 84 85 86
#define NAS_RAB_ESTABLI_RSP(mSGpTR)     (mSGpTR)->ittiMsg.nas_rab_est_rsp

#define NAS_CELL_SELECTION_CNF(mSGpTR)  (mSGpTR)->ittiMsg.nas_cell_selection_cnf
#define NAS_CELL_SELECTION_IND(mSGpTR)  (mSGpTR)->ittiMsg.nas_cell_selection_ind
#define NAS_PAGING_IND(mSGpTR)          (mSGpTR)->ittiMsg.nas_paging_ind
#define NAS_CONN_ESTABLI_CNF(mSGpTR)    (mSGpTR)->ittiMsg.nas_conn_establi_cnf
#define NAS_CONN_RELEASE_IND(mSGpTR)    (mSGpTR)->ittiMsg.nas_conn_release_ind
#define NAS_UPLINK_DATA_CNF(mSGpTR)     (mSGpTR)->ittiMsg.nas_ul_data_cnf
#define NAS_DOWNLINK_DATA_IND(mSGpTR)   (mSGpTR)->ittiMsg.nas_dl_data_ind
87 88

//-------------------------------------------------------------------------------------------//
89 90 91
typedef struct RrcStateInd_s {
  Rrc_State_t     state;
  Rrc_Sub_State_t sub_state;
92 93
} RrcStateInd;

94 95
// eNB: ENB_APP -> RRC messages
typedef struct RrcConfigurationReq_s {
96
  uint32_t            cell_identity;
97

98
  uint16_t            tac;
99

100 101 102 103
  uint16_t            mcc[PLMN_LIST_MAX_SIZE];
  uint16_t            mnc[PLMN_LIST_MAX_SIZE];
  uint8_t             mnc_digit_length[PLMN_LIST_MAX_SIZE];
  uint8_t             num_plmn;
104

105
  uint32_t            rrc_inactivity_timer_thres; // for testing, maybe change later
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
106

107
  paging_drx_t            default_drx;
knopp's avatar
knopp committed
108 109 110 111 112
  int16_t                 nb_cc;
  lte_frame_type_t        frame_type[MAX_NUM_CCs];
  uint8_t                 tdd_config[MAX_NUM_CCs];
  uint8_t                 tdd_config_s[MAX_NUM_CCs];
  lte_prefix_type_t       prefix_type[MAX_NUM_CCs];
113
  uint8_t                 pbch_repetition[MAX_NUM_CCs];
knopp's avatar
knopp committed
114 115 116 117 118
  int16_t                 eutra_band[MAX_NUM_CCs];
  uint32_t                downlink_frequency[MAX_NUM_CCs];
  int32_t                 uplink_frequency_offset[MAX_NUM_CCs];
  int16_t                 Nid_cell[MAX_NUM_CCs];// for testing, change later
  int16_t                 N_RB_DL[MAX_NUM_CCs];// for testing, change later
119
  int                     nb_antenna_ports[MAX_NUM_CCs];
120 121 122 123 124 125 126
  long                    prach_root[MAX_NUM_CCs];
  long                    prach_config_index[MAX_NUM_CCs];
  BOOLEAN_t               prach_high_speed[MAX_NUM_CCs];
  long                    prach_zero_correlation[MAX_NUM_CCs];
  long                    prach_freq_offset[MAX_NUM_CCs];
  long                    pucch_delta_shift[MAX_NUM_CCs];
  long                    pucch_nRB_CQI[MAX_NUM_CCs];
knopp's avatar
knopp committed
127
  long                    pucch_nCS_AN[MAX_NUM_CCs];
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
128
  //#if (LTE_RRC_VERSION < MAKE_VERSION(10, 0, 0))
129
  long                    pucch_n1_AN[MAX_NUM_CCs];
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
130
  //#endif
131 132
  long                    pdsch_referenceSignalPower[MAX_NUM_CCs];
  long                    pdsch_p_b[MAX_NUM_CCs];
knopp's avatar
knopp committed
133 134 135
  long                    pusch_n_SB[MAX_NUM_CCs];
  long                    pusch_hoppingMode[MAX_NUM_CCs];
  long                    pusch_hoppingOffset[MAX_NUM_CCs];
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
  BOOLEAN_t               pusch_enable64QAM[MAX_NUM_CCs];
  BOOLEAN_t               pusch_groupHoppingEnabled[MAX_NUM_CCs];
  long                    pusch_groupAssignment[MAX_NUM_CCs];
  BOOLEAN_t               pusch_sequenceHoppingEnabled[MAX_NUM_CCs];
  long                    pusch_nDMRS1[MAX_NUM_CCs];
  long                    phich_duration[MAX_NUM_CCs];
  long                    phich_resource[MAX_NUM_CCs];
  BOOLEAN_t               srs_enable[MAX_NUM_CCs];
  long                    srs_BandwidthConfig[MAX_NUM_CCs];
  long                    srs_SubframeConfig[MAX_NUM_CCs];
  BOOLEAN_t               srs_ackNackST[MAX_NUM_CCs];
  BOOLEAN_t               srs_MaxUpPts[MAX_NUM_CCs];
  long                    pusch_p0_Nominal[MAX_NUM_CCs];
  long                    pusch_alpha[MAX_NUM_CCs];
  long                    pucch_p0_Nominal[MAX_NUM_CCs];
  long                    msg3_delta_Preamble[MAX_NUM_CCs];
knopp's avatar
knopp committed
152
  long                    ul_CyclicPrefixLength[MAX_NUM_CCs];
153 154 155 156 157
  e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1                pucch_deltaF_Format1[MAX_NUM_CCs];
  e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b               pucch_deltaF_Format1b[MAX_NUM_CCs];
  e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2                pucch_deltaF_Format2[MAX_NUM_CCs];
  e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a               pucch_deltaF_Format2a[MAX_NUM_CCs];
  e_LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b               pucch_deltaF_Format2b[MAX_NUM_CCs];
158
  long                    rach_numberOfRA_Preambles[MAX_NUM_CCs];
knopp's avatar
knopp committed
159
  BOOLEAN_t               rach_preamblesGroupAConfig[MAX_NUM_CCs];
160 161
  long                    rach_sizeOfRA_PreamblesGroupA[MAX_NUM_CCs];
  long                    rach_messageSizeGroupA[MAX_NUM_CCs];
162
  e_LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB                rach_messagePowerOffsetGroupB[MAX_NUM_CCs];
163 164 165 166
  long                    rach_powerRampingStep[MAX_NUM_CCs];
  long                    rach_preambleInitialReceivedTargetPower[MAX_NUM_CCs];
  long                    rach_preambleTransMax[MAX_NUM_CCs];
  long                    rach_raResponseWindowSize[MAX_NUM_CCs];
knopp's avatar
knopp committed
167 168 169 170 171 172 173 174 175 176 177
  long                    rach_macContentionResolutionTimer[MAX_NUM_CCs];
  long                    rach_maxHARQ_Msg3Tx[MAX_NUM_CCs];
  long                    bcch_modificationPeriodCoeff[MAX_NUM_CCs];
  long                    pcch_defaultPagingCycle[MAX_NUM_CCs];
  long                    pcch_nB[MAX_NUM_CCs];
  long                    ue_TimersAndConstants_t300[MAX_NUM_CCs];
  long                    ue_TimersAndConstants_t301[MAX_NUM_CCs];
  long                    ue_TimersAndConstants_t310[MAX_NUM_CCs];
  long                    ue_TimersAndConstants_t311[MAX_NUM_CCs];
  long                    ue_TimersAndConstants_n310[MAX_NUM_CCs];
  long                    ue_TimersAndConstants_n311[MAX_NUM_CCs];
178
  long                    ue_TransmissionMode[MAX_NUM_CCs];
Xu Bo's avatar
Xu Bo committed
179
  long                    ue_multiple_max[MAX_NUM_CCs];
180 181 182

  //TTN - for D2D
  //SIB18
183 184 185
  e_LTE_SL_CP_Len_r12            rxPool_sc_CP_Len[MAX_NUM_CCs];
  e_LTE_SL_PeriodComm_r12        rxPool_sc_Period[MAX_NUM_CCs];
  e_LTE_SL_CP_Len_r12            rxPool_data_CP_Len[MAX_NUM_CCs];
186 187 188
  long                           rxPool_ResourceConfig_prb_Num[MAX_NUM_CCs];
  long                           rxPool_ResourceConfig_prb_Start[MAX_NUM_CCs];
  long                           rxPool_ResourceConfig_prb_End[MAX_NUM_CCs];
189
  LTE_SL_OffsetIndicator_r12_PR  rxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
190
  long                           rxPool_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
191
  LTE_SubframeBitmapSL_r12_PR    rxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
192
  char                          *rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
193 194 195 196 197
  long                           rxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
  long                           rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];

  //SIB19
  //for discRxPool
198 199
  LTE_SL_CP_Len_r12_t            discRxPool_cp_Len[MAX_NUM_CCs];
  e_LTE_SL_DiscResourcePool_r12__discPeriod_r12               discRxPool_discPeriod[MAX_NUM_CCs];
200 201 202 203 204
  long                           discRxPool_numRetx[MAX_NUM_CCs];
  long                           discRxPool_numRepetition[MAX_NUM_CCs];
  long                           discRxPool_ResourceConfig_prb_Num[MAX_NUM_CCs];
  long                           discRxPool_ResourceConfig_prb_Start[MAX_NUM_CCs];
  long                           discRxPool_ResourceConfig_prb_End[MAX_NUM_CCs];
205
  LTE_SL_OffsetIndicator_r12_PR  discRxPool_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
206
  long                           discRxPool_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
207
  LTE_SubframeBitmapSL_r12_PR    discRxPool_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
208
  char                          *discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
209 210 211
  long                           discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
  long                           discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
  //for discRxPoolPS
212 213
  LTE_SL_CP_Len_r12_t            discRxPoolPS_cp_Len[MAX_NUM_CCs];
  e_LTE_SL_DiscResourcePool_r12__discPeriod_r12                   discRxPoolPS_discPeriod[MAX_NUM_CCs];
214 215 216 217 218
  long                           discRxPoolPS_numRetx[MAX_NUM_CCs];
  long                           discRxPoolPS_numRepetition[MAX_NUM_CCs];
  long                           discRxPoolPS_ResourceConfig_prb_Num[MAX_NUM_CCs];
  long                           discRxPoolPS_ResourceConfig_prb_Start[MAX_NUM_CCs];
  long                           discRxPoolPS_ResourceConfig_prb_End[MAX_NUM_CCs];
219
  LTE_SL_OffsetIndicator_r12_PR  discRxPoolPS_ResourceConfig_offsetIndicator_present[MAX_NUM_CCs];
220
  long                           discRxPoolPS_ResourceConfig_offsetIndicator_choice[MAX_NUM_CCs];
221
  LTE_SubframeBitmapSL_r12_PR    discRxPoolPS_ResourceConfig_subframeBitmap_present[MAX_NUM_CCs];
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
222
  char                          *discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
223 224
  long                           discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
  long                           discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
225 226
} RrcConfigurationReq;

oai's avatar
oai committed
227
#define MAX_NUM_NBIOT_CELEVELS    3
228

oai's avatar
oai committed
229 230 231 232 233
typedef struct NbIoTRrcConfigurationReq_s {
  uint32_t            cell_identity;

  uint16_t            tac;

Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
234 235 236 237
  uint16_t        mcc;
  uint16_t        mnc;
  uint8_t       mnc_digit_length;
  lte_frame_type_t    frame_type;
oai's avatar
oai committed
238 239 240
  uint8_t                 tdd_config;
  uint8_t                 tdd_config_s;
  lte_prefix_type_t       prefix_type;
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
241
  lte_prefix_type_t   prefix_type_UL;
oai's avatar
oai committed
242 243 244 245 246 247
  int16_t                 eutra_band;
  uint32_t                downlink_frequency;
  int32_t                 uplink_frequency_offset;
  int16_t                 Nid_cell;// for testing, change later
  int16_t                 N_RB_DL;// for testing, change later
  //RACH
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
248 249 250 251 252
  long            rach_raResponseWindowSize_NB;
  long            rach_macContentionResolutionTimer_NB;
  long            rach_powerRampingStep_NB;
  long            rach_preambleInitialReceivedTargetPower_NB;
  long            rach_preambleTransMax_CE_NB;
oai's avatar
oai committed
253
  //BCCH
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
254
  long            bcch_modificationPeriodCoeff_NB;
oai's avatar
oai committed
255
  //PCCH
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
256 257 258
  long            pcch_defaultPagingCycle_NB;
  long            pcch_nB_NB;
  long            pcch_npdcch_NumRepetitionPaging_NB;
oai's avatar
oai committed
259
  //NPRACH
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
260 261 262 263 264 265 266 267 268 269 270 271
  long            nprach_CP_Length;
  long            nprach_rsrp_range;
  long            nprach_Periodicity[MAX_NUM_NBIOT_CELEVELS];
  long            nprach_StartTime[MAX_NUM_NBIOT_CELEVELS];
  long            nprach_SubcarrierOffset[MAX_NUM_NBIOT_CELEVELS];
  long            nprach_NumSubcarriers[MAX_NUM_NBIOT_CELEVELS];
  long            numRepetitionsPerPreambleAttempt_NB[MAX_NUM_NBIOT_CELEVELS];
  long            nprach_SubcarrierMSG3_RangeStart;
  long            maxNumPreambleAttemptCE_NB;
  long            npdcch_NumRepetitions_RA[MAX_NUM_NBIOT_CELEVELS];
  long            npdcch_StartSF_CSS_RA[MAX_NUM_NBIOT_CELEVELS];
  long            npdcch_Offset_RA[MAX_NUM_NBIOT_CELEVELS];
oai's avatar
oai committed
272
  //NPDSCH
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
273
  long            npdsch_nrs_Power;
oai's avatar
oai committed
274
  //NPUSCH
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
275 276 277 278 279 280
  long            npusch_ack_nack_numRepetitions_NB;
  long            npusch_srs_SubframeConfig_NB;
  long            npusch_threeTone_CyclicShift_r13;
  long            npusch_sixTone_CyclicShift_r13;
  BOOLEAN_t         npusch_groupHoppingEnabled;
  long            npusch_groupAssignmentNPUSCH_r13;
oai's avatar
oai committed
281 282

  //DL_GapConfig
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
283 284 285
  long            dl_GapThreshold_NB;
  long            dl_GapPeriodicity_NB;
  long            dl_GapDurationCoeff_NB;
oai's avatar
oai committed
286
  //Uplink power control Common
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
287 288 289
  long            npusch_p0_NominalNPUSCH;
  long            npusch_alpha;
  long            deltaPreambleMsg3;
oai's avatar
oai committed
290
  //UE timers and constants
Louis Adrien Dufrene's avatar
Louis Adrien Dufrene committed
291 292 293 294 295 296
  long            ue_TimersAndConstants_t300_NB;
  long            ue_TimersAndConstants_t301_NB;
  long            ue_TimersAndConstants_t310_NB;
  long            ue_TimersAndConstants_t311_NB;
  long            ue_TimersAndConstants_n310_NB;
  long            ue_TimersAndConstants_n311_NB;
oai's avatar
oai committed
297 298
} NbIoTRrcConfigurationReq;

299

300
// UE: NAS -> RRC messages
301
typedef kenb_refresh_req_t      NasKenbRefreshReq;
302 303 304 305
typedef cell_info_req_t         NasCellSelectionReq;
typedef nas_establish_req_t     NasConnEstabliReq;
typedef ul_info_transfer_req_t  NasUlDataReq;

306 307
typedef rab_establish_rsp_t     NasRabEstRsp;

308 309 310 311 312 313 314 315
// UE: RRC -> NAS messages
typedef cell_info_cnf_t         NasCellSelectionCnf;
typedef cell_info_ind_t         NasCellSelectionInd;
typedef paging_ind_t            NasPagingInd;
typedef nas_establish_cnf_t     NasConnEstabCnf;
typedef nas_release_ind_t       NasConnReleaseInd;
typedef ul_info_transfer_cnf_t  NasUlDataCnf;
typedef dl_info_transfer_ind_t  NasDlDataInd;
316 317

#endif /* RRC_MESSAGES_TYPES_H_ */