main_NB_IoT.c 2.28 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 31 32
/*
 * 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.0  (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 main.c
 * \brief top init of Layer 2
 * \author  Navid Nikaein and Raymond Knopp, Michele Paffetti
 * \date 2010 - 2014
 * \version 1.0
 * \email: navid.nikaein@eurecom.fr, michele.paffetti@studio.unibo.it
 * @ingroup _mac

 */


33 34 35 36
//#include "asn1_constants.h"
#include "LAYER2/MAC/defs_NB_IoT.h"
#include "LAYER2/MAC/proto_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
37
#include "RRC/LITE/proto_NB_IoT.h"
38

39
int mac_init_global_param_NB_IoT(void)
40 41
{

42 43 44
  if (rlc_module_init()!=0) {
    return(-1);
 }
45 46

  LOG_I(MAC,"[MAIN] RRC NB-IoT initialization of global params\n");
47
  rrc_init_global_param_NB_IoT();
48 49


50 51 52 53 54 55
  LOG_I(MAC,"[MAIN] PDCP layer init\n");
#ifdef USER_MODE
  pdcp_layer_init ();
#else
  pdcp_module_init ();
#endif
56 57 58 59

  return 0;
}

60 61

// Initial function of the intialization for NB-IoT MAC
62
int mac_top_init_NB_IoT()
Nick Ho's avatar
Nick Ho committed
63 64 65 66
{

}

67

68
int l2_init_eNB_NB_IoT()
69 70
{

Nick Ho's avatar
Nick Ho committed
71
  LOG_I(MAC,"[MAIN] Mapping L2 IF-Module functions\n");
72 73 74 75
  IF_Module_init_L2();

  LOG_I(MAC,"[MAIN] MAC_INIT_GLOBAL_PARAM NB-IoT IN...\n");

76
  Is_rrc_registered_NB_IoT=0;
77
  mac_init_global_param_NB_IoT();
78
  Is_rrc_registered_NB_IoT=1;
79

Nick Ho's avatar
Nick Ho committed
80

81
  LOG_D(MAC,"[MAIN][NB-IoT] ALL INIT OK\n");
82

83
//    mac_xface->macphy_init(eMBMS_active,uecap_xer,cba_group_active,HO_active); (old mac_top_init)
84
  mac_top_init_NB_IoT();
85 86 87 88

  return(1);
}