mac_proto.h 4.16 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 35
#include "nr_mac_gNB.h"
#include "PHY/defs_gNB.h"
36 37 38 39 40

void mac_top_init_gNB(void);

int rrc_mac_config_req_gNB(module_id_t Mod_idP, 
                           int CC_id,
41
						   int cellid,
42
                           int p_gNB,
43
                           int nr_bandP,
44
                           uint64_t ssb_pattern,
45
                           uint64_t dl_CarrierFreqP,
46 47 48 49 50
                           int dl_BandwidthP,
                           NR_BCCH_BCH_Message_t *mib,
                           NR_ServingCellConfigCommon_t *servingcellconfigcommon
                           );

51
int  is_nr_UL_slot(NR_COMMON_channels_t * ccP, int slotP);
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
52

WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
53 54 55
void clear_nr_nfapi_information(gNB_MAC_INST * gNB, 
                                int CC_idP,
                                frame_t frameP, 
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
56
                                sub_frame_t subframeP);
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
57

58 59 60 61
void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, 
                               frame_t frameP,
                               sub_frame_t subframeP);

WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
62 63
void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP);

Raymond Knopp's avatar
Raymond Knopp committed
64 65 66 67 68 69 70


void nr_schedule_css_dlsch_phytest(module_id_t   module_idP,
                                   frame_t       frameP,
                                   sub_frame_t   subframeP);


71 72 73 74 75 76
void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
				  nr_scs_e scs_common,
				  nr_scs_e pdcch_scs,
				  nr_frequency_range_e freq_range,
				  uint8_t rmsi_pdcch_config,
				  uint8_t ssb_idx,
77 78 79
          uint8_t k_ssb,
          uint16_t sfn_ssb,
          uint8_t n_ssb,
80 81
				  uint16_t nb_slots_per_frame,
				  uint16_t N_RB);
Raymond Knopp's avatar
Raymond Knopp committed
82

83 84 85 86 87
int nr_is_dci_opportunity(nfapi_nr_search_space_t search_space,
                                nfapi_nr_coreset_t coreset,
                                uint16_t frame,
                                uint16_t slot,
                                nfapi_nr_config_request_t cfg);
Raymond Knopp's avatar
Raymond Knopp committed
88

Guy De Souza's avatar
Guy De Souza committed
89
void nr_configure_dci_from_pdcch_config(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
Raymond Knopp's avatar
Raymond Knopp committed
90
                                            nfapi_nr_coreset_t* coreset,
91 92
                                            nfapi_nr_search_space_t* search_space,
                                            nfapi_nr_config_request_t cfg,
Guy De Souza's avatar
Guy De Souza committed
93
                                            uint16_t N_RB);
Raymond Knopp's avatar
Raymond Knopp committed
94

95 96 97 98 99 100 101 102
int get_dlscs(nfapi_nr_config_request_t *cfg);

int get_ulscs(nfapi_nr_config_request_t *cfg);

int get_spf(nfapi_nr_config_request_t *cfg);

int to_absslot(nfapi_nr_config_request_t *cfg,int frame,int slot);

103 104
int get_symbolsperslot(nfapi_nr_config_request_t *cfg);

105 106
void get_band(uint32_t downlink_frequency,   uint8_t *current_band,   int32_t *current_offset, lte_frame_type_t *current_type);

107 108 109 110
uint64_t from_nrarfcn(int nr_bandP, uint32_t dl_nrarfcn);

uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint32_t bw);

111
#endif /*__LAYER2_NR_MAC_PROTO_H__*/