mac_proto.h 19.5 KB
Newer Older
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
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
/*
 * 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 mac_proto.h
 * \brief MAC functions prototypes for gNB
 * \author Navid Nikaein and Raymond Knopp, WEI-TAI CHEN
 * \date 2010 - 2014, 2018
 * \email navid.nikaein@eurecom.fr, kroempa@gmail.com
 * \version 1.0
 * \company Eurecom, NTUST
 */
30 31 32 33

#ifndef __LAYER2_NR_MAC_PROTO_H__
#define __LAYER2_NR_MAC_PROTO_H__

34
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
35
#include "NR_TAG-Id.h"
36
#include "common/ngran_types.h"
37

38
void set_cset_offset(uint16_t);
39
void get_K1_K2(int N1, int N2, int *K1, int *K2, int layers);
40
int get_NTN_Koffset(const NR_ServingCellConfigCommon_t *scc);
41

42 43 44 45
void mac_top_init_gNB(ngran_node_t node_type,
                      NR_ServingCellConfigCommon_t *scc,
                      NR_ServingCellConfig_t *scd,
                      const nr_mac_config_t *conf);
46
void nr_mac_send_f1_setup_req(void);
47

48
void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, const nr_mac_config_t *mac_config);
49 50
void nr_mac_configure_sib1(gNB_MAC_INST *nrmac, const f1ap_plmn_t *plmn, uint64_t cellID, int tac);

51
bool nr_mac_add_test_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup);
52
bool nr_mac_prepare_ra_ue(gNB_MAC_INST *nrmac, uint32_t rnti, NR_CellGroupConfig_t *CellGroup);
53 54 55

bool nr_mac_prepare_cellgroup_update(gNB_MAC_INST *nrmac, NR_UE_info_t *UE, NR_CellGroupConfig_t *CellGroup);
int nr_mac_enable_ue_rrc_processing_timer(gNB_MAC_INST *mac, NR_UE_info_t *UE, bool apply_cellGroup);
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
56

57
void clear_nr_nfapi_information(gNB_MAC_INST *gNB,
58
                                int CC_idP,
59 60 61 62 63
                                frame_t frameP,
                                sub_frame_t slotP,
                                nfapi_nr_dl_tti_request_t *DL_req,
                                nfapi_nr_tx_data_request_t *TX_req,
                                nfapi_nr_ul_dci_request_t *UL_dci_req);
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
64

65 66 67 68
void nr_mac_update_timers(module_id_t module_id,
                          frame_t frame,
                          sub_frame_t slot);

69
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame_rxP, sub_frame_t slot_rxP, NR_Sched_Rsp_t *sched_info);
70

71 72 73
/* \brief main DL scheduler function. Calls a preprocessor to decide on
 * resource allocation, then "post-processes" resource allocation (nFAPI
 * messages, statistics, HARQ handling, CEs, ... */
74 75
void nr_schedule_ue_spec(module_id_t module_id,
                         frame_t frame,
76 77 78
                         sub_frame_t slot,
                         nfapi_nr_dl_tti_request_t *DL_req,
                         nfapi_nr_tx_data_request_t *TX_req);
79

80
/* \brief default FR1 DL preprocessor init routine, returns preprocessor to call */
81
nr_pp_impl_dl nr_init_fr1_dlsch_preprocessor(int CC_id);
rmagueta's avatar
rmagueta committed
82

83 84 85 86 87
void schedule_nr_sib1(module_id_t module_idP,
                      frame_t frameP,
                      sub_frame_t slotP,
                      nfapi_nr_dl_tti_request_t *DL_req,
                      nfapi_nr_tx_data_request_t *TX_req);
88

89
void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP, nfapi_nr_dl_tti_request_t *DL_req);
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
90

91 92 93
/* \brief main UL scheduler function. Calls a preprocessor to decide on
 * resource allocation, then "post-processes" resource allocation (nFAPI
 * messages, statistics, HARQ handling, ... */
94
void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot, nfapi_nr_ul_dci_request_t *ul_dci_req);
95

96
/* \brief default FR1 UL preprocessor init routine, returns preprocessor to call */
97
nr_pp_impl_ul nr_init_fr1_ulsch_preprocessor(int CC_id);
98

99 100
/////// Random Access MAC-PHY interface functions and primitives ///////

101 102 103 104 105 106
void nr_schedule_RA(module_id_t module_idP,
                    frame_t frameP,
                    sub_frame_t slotP,
                    nfapi_nr_ul_dci_request_t *ul_dci_req,
                    nfapi_nr_dl_tti_request_t *DL_req,
                    nfapi_nr_tx_data_request_t *TX_req);
107 108 109 110 111 112 113 114 115

/* \brief Function to indicate a received preamble on PRACH.  It initiates the RA procedure.
@param module_idP Instance ID of gNB
@param preamble_index index of the received RA request
@param slotP Slot number on which to act
@param timing_offset Offset in samples of the received PRACH w.r.t. eNB timing. This is used to
@param rnti RA rnti corresponding to this PRACH preamble
@param rach_resource type (0=non BL/CE,1 CE level 0,2 CE level 1, 3 CE level 2,4 CE level 3)
*/
116 117
void nr_initiate_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP,
                         uint16_t preamble_index, uint8_t freq_index, uint8_t symbol, int16_t timing_offset);
118

Robert Schmidt's avatar
Robert Schmidt committed
119
void nr_clear_ra_proc(NR_RA_t *ra);
120 121 122

int nr_allocate_CCEs(int module_idP, int CC_idP, frame_t frameP, sub_frame_t slotP, int test_only);

123 124
void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP);

125 126 127 128
uint16_t nr_mac_compute_RIV(uint16_t N_RB_DL, uint16_t RBstart, uint16_t Lcrbs);

/////// Phy test scheduler ///////

Robert Schmidt's avatar
Robert Schmidt committed
129 130 131 132
/* \brief preprocessor for phytest: schedules UE_id 0 with fixed MCS on all
 * freq resources */
void nr_preprocessor_phytest(module_id_t module_id,
                             frame_t frame,
133
                             sub_frame_t slot);
134 135
/* \brief UL preprocessor for phytest: schedules UE_id 0 with fixed MCS on a
 * fixed set of resources */
136
bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_t slot);
Robert Schmidt's avatar
Robert Schmidt committed
137

138 139 140 141 142 143 144 145 146
void handle_nr_uci_pucch_0_1(module_id_t mod_id,
                             frame_t frame,
                             sub_frame_t slot,
                             const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_01);
void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
                               frame_t frame,
                               sub_frame_t slot,
                               const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234);

147
void config_uldci(const NR_UE_ServingCell_Info_t *sc_info,
148
                  const nfapi_nr_pusch_pdu_t *pusch_pdu,
149
                  dci_pdu_rel15_t *dci_pdu_rel15,
150
                  nr_srs_feedback_t *srs_feedback,
151 152
                  int time_domain_assignment,
                  uint8_t tpc,
153
                  uint8_t ndi,
francescomani's avatar
francescomani committed
154
                  NR_UE_UL_BWP_t *ul_bwp);
155

156
void nr_schedule_pucch(gNB_MAC_INST *nrmac,
157 158 159
                       frame_t frameP,
                       sub_frame_t slotP);

160 161 162 163
void nr_srs_ri_computation(const nfapi_nr_srs_normalized_channel_iq_matrix_t *nr_srs_normalized_channel_iq_matrix,
                           const NR_UE_UL_BWP_t *current_BWP,
                           uint8_t *ul_ri);

164 165
int get_pucch_resourceid(NR_PUCCH_Config_t *pucch_Config, int O_uci, int pucch_resource);

166
void nr_schedule_srs(int module_id, frame_t frame, int slot);
167

168
void nr_csirs_scheduling(int Mod_idP, frame_t frame, sub_frame_t slot, int n_slots_frame, nfapi_nr_dl_tti_request_t *DL_req);
169

170 171
void nr_csi_meas_reporting(int Mod_idP,
                           frame_t frameP,
172
                           sub_frame_t slotP);
173

francescomani's avatar
francescomani committed
174
int nr_acknack_scheduling(gNB_MAC_INST *mac,
Roberto Louro Magueta's avatar
Roberto Louro Magueta committed
175
                          NR_UE_info_t *UE,
176 177 178 179
                          frame_t frameP,
                          sub_frame_t slotP,
                          int r_pucch,
                          int do_common);
Francesco Mani's avatar
Francesco Mani committed
180

181 182 183
int get_pdsch_to_harq_feedback(NR_PUCCH_Config_t *pucch_Config,
                               nr_dci_format_t dci_format,
                               uint8_t *pdsch_to_harq_feedback);
184
  
185
int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset,
francescomani's avatar
francescomani committed
186
                          NR_PUCCH_Config_t *pucch_Config,
187 188
                          int CCEIndex);

francescomani's avatar
francescomani committed
189
void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
190
                        NR_ServingCellConfigCommon_t *scc,
191
                        NR_UE_info_t* UE,
192
                        uint8_t pucch_resource,
193
                        uint16_t O_csi,
194
                        uint16_t O_ack,
195
                        uint8_t O_sr,
196
                        int r_pucch);
Francesco Mani's avatar
Francesco Mani committed
197

198 199 200 201
void find_search_space(int ss_type,
                       NR_BWP_Downlink_t *bwp,
                       NR_SearchSpace_t *ss);

202
void nr_configure_pdcch(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu,
203
                        NR_ControlResourceSet_t *coreset,
204 205
                        NR_sched_pdcch_t *pdcch);

206 207 208 209 210 211
NR_sched_pdcch_t set_pdcch_structure(gNB_MAC_INST *gNB_mac,
                                     NR_SearchSpace_t *ss,
                                     NR_ControlResourceSet_t *coreset,
                                     NR_ServingCellConfigCommon_t *scc,
                                     NR_BWP_t *bwp,
                                     NR_Type0_PDCCH_CSS_config_t *type0_PDCCH_CSS_config);
212

213
int find_pdcch_candidate(const gNB_MAC_INST *mac,
214 215 216
                         int cc_id,
                         int aggregation,
                         int nr_of_candidates,
217 218
                         const NR_sched_pdcch_t *pdcch,
                         const NR_ControlResourceSet_t *coreset,
219
                         uint32_t Y);
220 221 222 223 224 225

void fill_pdcch_vrb_map(gNB_MAC_INST *mac,
                        int CC_id,
                        NR_sched_pdcch_t *pdcch,
                        int first_cce,
                        int aggregation);
Raymond Knopp's avatar
Raymond Knopp committed
226

227
void fill_dci_pdu_rel15(const NR_UE_ServingCell_Info_t *servingCellInfo,
228 229
                        const NR_UE_DL_BWP_t *current_DL_BWP,
                        const NR_UE_UL_BWP_t *current_UL_BWP,
230
                        nfapi_nr_dl_dci_pdu_t *pdcch_dci_pdu,
cig's avatar
cig committed
231
                        dci_pdu_rel15_t *dci_pdu_rel15,
232 233
                        int dci_format,
                        int rnti_type,
234
                        int bwp_id,
235
                        NR_SearchSpace_t *ss,
236
                        NR_ControlResourceSet_t *coreset,
237
                        long pdsch_HARQ_ACK_Codebook,
238
                        uint16_t cset0_bwp_size);
Francesco Mani's avatar
Francesco Mani committed
239

240 241 242 243 244
void prepare_dci(const NR_UE_ServingCell_Info_t *servingCellInfo,
                 const NR_UE_DL_BWP_t *current_BWP,
                 const NR_ControlResourceSet_t *coreset,
                 dci_pdu_rel15_t *dci_pdu_rel15,
                 nr_dci_format_t format);
245

246 247 248 249 250 251 252 253
void set_r_pucch_parms(int rsetindex,
                       int r_pucch,
                       int bwp_size,
                       int *prb_start,
                       int *second_hop_prb,
                       int *nr_of_symbols,
                       int *start_symbol_index);

254
/* find coreset within the search space */
Laurent THOMAS's avatar
Laurent THOMAS committed
255
NR_ControlResourceSet_t *get_coreset(gNB_MAC_INST *nrmac,
256
                                     NR_ServingCellConfigCommon_t *scc,
Eurecom's avatar
Eurecom committed
257
                                     void *bwp,
258
                                     NR_SearchSpace_t *ss,
259
                                     NR_SearchSpace__searchSpaceType_PR ss_type);
260 261

/* find a search space within a BWP */
262
NR_SearchSpace_t *get_searchspace(NR_ServingCellConfigCommon_t *scc,
263 264
                                  NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
                                  NR_SearchSpace__searchSpaceType_PR target_ss);
265

266
long get_K2(NR_PUSCH_TimeDomainResourceAllocationList_t *tdaList,
267
            int time_domain_assignment,
268 269
            int mu,
            const NR_ServingCellConfigCommon_t *scc);
270

271 272
const NR_DMRS_UplinkConfig_t *get_DMRS_UplinkConfig(const NR_PUSCH_Config_t *pusch_Config, const NR_tda_info_t *tda_info);

francescomani's avatar
francescomani committed
273 274 275 276
NR_pusch_dmrs_t get_ul_dmrs_params(const NR_ServingCellConfigCommon_t *scc,
                                   const NR_UE_UL_BWP_t *ul_bwp,
                                   const NR_tda_info_t *tda_info,
                                   const int Layers);
277

278
uint8_t nr_get_tpc(int target, uint8_t cqi, int incr, int tx_power);
279

280
int get_spf(nfapi_nr_config_request_scf_t *cfg);
281

282
int to_absslot(nfapi_nr_config_request_scf_t *cfg,int frame,int slot);
283

Raymond Knopp's avatar
Raymond Knopp committed
284
void nr_get_tbs_dl(nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
285
		   int x_overhead,
286
                   uint8_t numdmrscdmgroupnodata,
287
                   uint8_t tb_scaling);
288 289 290 291 292

int NRRIV2BW(int locationAndBandwidth,int N_RB);

int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);

293 294
/* Functions to manage an NR_list_t */
void create_nr_list(NR_list_t *listP, int len);
295
void resize_nr_list(NR_list_t *list, int new_len);
296 297 298 299 300 301
void destroy_nr_list(NR_list_t *list);
void add_nr_list(NR_list_t *listP, int id);
void remove_nr_list(NR_list_t *listP, int id);
void add_tail_nr_list(NR_list_t *listP, int id);
void add_front_nr_list(NR_list_t *listP, int id);
void remove_front_nr_list(NR_list_t *listP);
302

Laurent THOMAS's avatar
Laurent THOMAS committed
303
NR_UE_info_t * find_nr_UE(NR_UEs_t* UEs, rnti_t rntiP);
304

305
void configure_UE_BWP(gNB_MAC_INST *nr_mac,
306
                      NR_ServingCellConfigCommon_t *scc,
307
                      NR_UE_sched_ctrl_t *sched_ctrl,
308
                      NR_RA_t *ra,
309 310 311
                      NR_UE_info_t *UE,
                      int dl_bwp_switch,
                      int ul_bwp_switch);
312 313

NR_UE_info_t* add_new_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rntiP, NR_CellGroupConfig_t *CellGroup);
314

Laurent THOMAS's avatar
Laurent THOMAS committed
315
void mac_remove_nr_ue(gNB_MAC_INST *nr_mac, rnti_t rnti);
Cedric Roux's avatar
Cedric Roux committed
316

317 318
int nr_get_default_pucch_res(int pucch_ResourceCommon);

319 320 321 322 323
int nr_write_ce_dlsch_pdu(module_id_t module_idP,
                          const NR_UE_sched_ctrl_t *ue_sched_ctl,
                          unsigned char *mac_pdu,
                          unsigned char drx_cmd,
                          unsigned char *ue_cont_res_id);
324

325 326
int binomial(int n, int k);

327 328
bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot);

329 330 331 332 333 334 335 336 337 338
/* \brief Function to indicate a received SDU on ULSCH.
@param Mod_id Instance ID of gNB
@param CC_id Component carrier index
@param rnti RNTI of UE transmitting the SDU
@param sdu Pointer to received SDU
@param sdu_len Length of SDU
@param timing_advance timing advance adjustment after this pdu
@param ul_cqi Uplink CQI estimate after this pdu (SNR quantized to 8 bits, -64 ... 63.5 dB in .5dB steps)
*/
void nr_rx_sdu(const module_id_t gnb_mod_idP,
cig's avatar
cig committed
339 340 341 342 343
               const int CC_idP,
               const frame_t frameP,
               const sub_frame_t subframeP,
               const rnti_t rntiP,
               uint8_t * sduP,
344
               const uint32_t sdu_lenP,
345
               const int8_t harq_pid,
346 347 348
               const uint16_t timing_advance,
               const uint8_t ul_cqi,
               const uint16_t rssi);
349

350
void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, const NR_UE_ServingCell_Info_t *sc_info);
351

352 353
void create_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl, const NR_UE_ServingCell_Info_t *sc_info);

354 355 356 357
void reset_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl);

void reset_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl);

358 359
void handle_nr_ul_harq(const int CC_idP,
                       module_id_t mod_id,
360 361 362
                       frame_t frame,
                       sub_frame_t slot,
                       const nfapi_nr_crc_t *crc_pdu);
363

364 365 366
void handle_nr_srs_measurements(const module_id_t module_id,
                                const frame_t frame,
                                const sub_frame_t slot,
367
                                nfapi_nr_srs_indication_pdu_t *srs_ind);
368

369
void find_SSB_and_RO_available(gNB_MAC_INST *nrmac);
370

francescomani's avatar
francescomani committed
371 372 373 374
NR_pdsch_dmrs_t get_dl_dmrs_params(const NR_ServingCellConfigCommon_t *scc,
                                   const NR_UE_DL_BWP_t *BWP,
                                   const NR_tda_info_t *tda_info,
                                   const int Layers);
375

376 377
uint16_t get_pm_index(const gNB_MAC_INST *nrmac,
                      const NR_UE_info_t *UE,
378
                      nr_dci_format_t dci_format,
379
                      int layers,
380
                      int xp_pdsch_antenna_ports);
381

382
uint8_t get_mcs_from_cqi(int mcs_table, int cqi_table, int cqi_idx);
francescomani's avatar
francescomani committed
383

francescomani's avatar
francescomani committed
384
uint8_t get_dl_nrOfLayers(const NR_UE_sched_ctrl_t *sched_ctrl, const nr_dci_format_t dci_format);
385

386
void set_sched_pucch_list(NR_UE_sched_ctrl_t *sched_ctrl,
francescomani's avatar
francescomani committed
387 388
                          const NR_UE_UL_BWP_t *ul_bwp,
                          const NR_ServingCellConfigCommon_t *scc);
Robert Schmidt's avatar
Robert Schmidt committed
389
void free_sched_pucch_list(NR_UE_sched_ctrl_t *sched_ctrl);
390

mir's avatar
mir committed
391 392
int get_dl_tda(const gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int slot);
int get_ul_tda(gNB_MAC_INST *nrmac, const NR_ServingCellConfigCommon_t *scc, int frame, int slot);
393

394 395 396 397 398 399 400 401 402
int get_cce_index(const gNB_MAC_INST *nrmac,
                  const int CC_id,
                  const int slot,
                  const rnti_t rnti,
                  uint8_t *aggregation_level,
                  const NR_SearchSpace_t *ss,
                  const NR_ControlResourceSet_t *coreset,
                  NR_sched_pdcch_t *sched_pdcch,
                  bool is_common);
403 404 405

bool nr_find_nb_rb(uint16_t Qm,
                   uint16_t R,
406
                   long transform_precoding,
407
                   uint8_t nrOfLayers,
408 409 410
                   uint16_t nb_symb_sch,
                   uint16_t nb_dmrs_prb,
                   uint32_t bytes,
411
                   uint16_t nb_rb_min,
412 413 414 415
                   uint16_t nb_rb_max,
                   uint32_t *tbs,
                   uint16_t *nb_rb);

416 417 418 419 420 421
int get_mcs_from_bler(const NR_bler_options_t *bler_options,
                      const NR_mac_dir_stats_t *stats,
                      NR_bler_stats_t *bler_stats,
                      int max_mcs,
                      frame_t frame);

422 423
int ul_buffer_index(int frame, int slot, int scs, int size);

424
void UL_tti_req_ahead_initialization(gNB_MAC_INST *gNB, int n, int CCid, frame_t frameP, int slotP);
425

francescomani's avatar
francescomani committed
426
void nr_sr_reporting(gNB_MAC_INST *nrmac, frame_t frameP, sub_frame_t slotP);
imad's avatar
imad committed
427

428
size_t dump_mac_stats(gNB_MAC_INST *gNB, char *output, size_t strlen, bool reset_rsrp);
Laurent THOMAS's avatar
Laurent THOMAS committed
429

430 431
long get_lcid_from_drbid(int drb_id);
long get_lcid_from_srbid(int srb_id);
Laurent THOMAS's avatar
Laurent THOMAS committed
432

433
void prepare_initial_ul_rrc_message(gNB_MAC_INST *mac, NR_UE_info_t *UE);
434
void send_initial_ul_rrc_message(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data);
435

436
void finish_nr_dl_harq(NR_UE_sched_ctrl_t *sched_ctrl, int harq_pid);
francescomani's avatar
francescomani committed
437 438
void abort_nr_dl_harq(NR_UE_info_t* UE, int8_t harq_pid);

439 440
void nr_mac_trigger_release_timer(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing);
bool nr_mac_check_release(NR_UE_sched_ctrl_t *sched_ctrl, int rnti);
441
void nr_mac_trigger_release_complete(gNB_MAC_INST *mac, int rnti);
442
void nr_mac_release_ue(gNB_MAC_INST *mac, int rnti);
443

444 445 446 447
void nr_mac_trigger_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl, NR_SubcarrierSpacing_t subcarrier_spacing);
void nr_mac_reset_ul_failure(NR_UE_sched_ctrl_t *sched_ctrl);
void nr_mac_check_ul_failure(const gNB_MAC_INST *nrmac, int rnti, NR_UE_sched_ctrl_t *sched_ctrl);

448 449
void nr_mac_trigger_reconfiguration(const gNB_MAC_INST *nrmac, const NR_UE_info_t *UE);

450 451 452 453 454
void process_addmod_bearers_cellGroupConfig(NR_UE_sched_ctrl_t *sched_ctrl,
                                            const struct NR_CellGroupConfig__rlc_BearerToAddModList *addmod);

bool nr_mac_add_lcid(NR_UE_sched_ctrl_t *sched_ctrl, const nr_lc_config_t *c);
bool nr_mac_remove_lcid(NR_UE_sched_ctrl_t *sched_ctrl, long lcid);
455

456
#endif /*__LAYER2_NR_MAC_PROTO_H__*/