rrc_proto.h 6.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * 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
 */

22
/* \file proto.h
23
 * \brief RRC functions prototypes for eNB and UE
24 25 26 27 28 29 30
 * \author R. Knopp, K.H. HSU
 * \date 2018
 * \version 0.1
 * \company Eurecom / NTUST
 * \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
 * \note
 * \warning
31
 */
32

33 34
#ifndef _RRC_PROTO_H_
#define _RRC_PROTO_H_
35 36


37 38 39 40 41
#include "rrc_defs.h"
#include "NR_RRCReconfiguration.h"
#include "NR_MeasConfig.h"
#include "NR_CellGroupConfig.h"
#include "NR_RadioBearerConfig.h"
42
#include "openair2/PHY_INTERFACE/queue_t.h"
43
#include "common/utils/ocp_itti/intertask_interface.h"
44 45 46 47

extern queue_t nr_rach_ind_queue;
extern queue_t nr_rx_ind_queue;
extern queue_t nr_crc_ind_queue;
48
extern queue_t nr_uci_ind_queue;
49
extern queue_t nr_sfn_slot_queue;
50
extern queue_t nr_chan_param_queue;
51 52 53 54
extern queue_t nr_dl_tti_req_queue;
extern queue_t nr_tx_req_queue;
extern queue_t nr_ul_dci_req_queue;
extern queue_t nr_ul_tti_req_queue;
55 56 57 58
//
//  main_rrc.c
//
/**\brief Layer 3 initialization*/
59
NR_UE_RRC_INST_t* nr_l3_init_ue(char*,char*);
60 61 62 63 64 65

//
//  UE_rrc.c
//

/**\brief Initial the top level RRC structure instance*/
66
NR_UE_RRC_INST_t* openair_rrc_top_init_ue_nr(char*,char*);
67

68

69 70

/**\brief Decode RRC Connection Reconfiguration, sent from E-UTRA RRC Connection Reconfiguration v1510 carring EN-DC config
71 72
   \param buffer  encoded NR-RRC-Connection-Reconfiguration/Secondary-Cell-Group-Config message.
   \param size    length of buffer*/
73
//TODO check to use which one
74
//int8_t nr_rrc_ue_decode_rrcReconfiguration(const uint8_t *buffer, const uint32_t size);
75
int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const module_id_t module_id, const uint8_t *buffer, const uint32_t size);
76
   
77 78

/**\brief Process NR RRC connection reconfiguration via SRB3
79
   \param rrcReconfiguration  decoded rrc connection reconfiguration*/
80
int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCReconfiguration_t *rrcReconfiguration);
81 82

/**\prief Process measurement config from NR RRC connection reconfiguration message
83
   \param meas_config   measurement configuration*/
84
int8_t nr_rrc_ue_process_meas_config(NR_MeasConfig_t *meas_config);
85 86

/**\prief Process radio bearer config from NR RRC connection reconfiguration message
87
   \param radio_bearer_config    radio bearer configuration*/
88
int8_t nr_rrc_ue_process_radio_bearer_config(NR_RadioBearerConfig_t *radio_bearer_config);
89

90 91 92 93 94 95 96
/**\brief decode NR BCCH-BCH (MIB) message
   \param module_idP    module id
   \param gNB_index     gNB index
   \param sduP          pointer to buffer of ASN message BCCH-BCH
   \param sdu_len       length of buffer*/
int8_t nr_rrc_ue_decode_NR_BCCH_BCH_Message(const module_id_t module_id, const uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len);

97
/**\brief decode NR BCCH-DLSCH (SI) messages
rmagueta's avatar
rmagueta committed
98 99
   \param module_idP    module id
   \param gNB_index     gNB index
100 101 102 103 104
   \param sduP          pointer to buffer of ASN message BCCH-DLSCH
   \param sdu_len       length of buffer
   \param rsrq          RSRQ
   \param rsrp          RSRP*/
int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(const module_id_t module_id, const uint8_t gNB_index, uint8_t *const bufferP, const uint8_t buffer_len, const uint8_t rsrq, const uint8_t rsrp);
105

106
/**\brief Decode NR DCCH from gNB, sent from lower layer through SRB3
107 108 109 110 111 112 113 114 115 116 117 118 119
   \param module_id  module id
   \param gNB_index  gNB index
   \param buffer     encoded DCCH bytes stream message
   \param size       length of buffer*/
int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(const module_id_t module_id, const uint8_t gNB_index, const uint8_t *buffer, const uint32_t size);

/**\brief interface between MAC and RRC thru SRB0 (RLC TM/no PDCP)
   \param module_id  module id
   \param CC_id      component carrier id
   \param gNB_index  gNB index
   \param channel    indicator for channel of the pdu
   \param pduP       pointer to pdu
   \param pdu_len    data length of pdu*/
120 121 122 123 124 125 126 127 128
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
                              const int CC_id,
                              const uint8_t gNB_index,
                              const frame_t frame,
                              const sub_frame_t sub_frame,
                              const rnti_t rnti,
                              const channel_t channel,
                              const uint8_t* pduP,
                              const sdu_size_t pdu_len);
129

cig's avatar
cig committed
130 131 132
/**\brief
   \param module_id  module id
   \param CC_id      component carrier id
rmagueta's avatar
rmagueta committed
133
   \param gNB_index  gNB index
cig's avatar
cig committed
134 135 136
   \param frame_t    frameP
   \param rb_id_t    SRB id
   \param buffer_pP  pointer to buffer*/
rmagueta's avatar
rmagueta committed
137
int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
cig's avatar
cig committed
138
                              const int         CC_id,
rmagueta's avatar
rmagueta committed
139
                              const uint8_t     gNB_id,
cig's avatar
cig committed
140 141
                              const frame_t     frameP,
                              const rb_id_t     Srb_id,
rmagueta's avatar
rmagueta committed
142
                              uint8_t           *buffer_pP);
heshanyun's avatar
heshanyun committed
143

144 145
int8_t nr_rrc_RA_succeeded(const module_id_t mod_id, const uint8_t gNB_index);

heshanyun's avatar
heshanyun committed
146 147 148
/**\brief RRC UE task.
   \param void *args_p Pointer on arguments to start the task. */
void *rrc_nrue_task(void *args_p);
Xue Song's avatar
Xue Song committed
149

150 151 152
/**\brief RRC timers update at UE. */
void *nr_rrc_timers_update();

153 154 155 156
/**\brief RRC NSA UE task.
   \param void *args_p Pointer on arguments to start the task. */
void *recv_msgs_from_lte_ue(void *args_p);

157 158
void init_connections_with_lte_ue(void);

159
void nsa_sendmsg_to_lte_ue(const void *message, size_t msg_len, Rrc_Msg_Type_t msg_type);
160

161 162
void start_oai_nrue_threads(void);

Xue Song's avatar
Xue Song committed
163
/**\brief RRC UE generate RRCSetupRequest message.
rmagueta's avatar
rmagueta committed
164
   \param module_id  module id
Xue Song's avatar
Xue Song committed
165
   \param gNB_index  gNB index  */
166
void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB_index);
Xue Song's avatar
Xue Song committed
167

168 169 170 171
void process_lte_nsa_msg(nsa_msg_t *msg, int msg_len);

int get_from_lte_ue_fd();

172
/** @}*/
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
173 174
#endif