/* * 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 */ /*________________________openair_rrc_top.c________________________ Authors : Hicham Anouar Company : EURECOM Emails : anouar@eurecom.fr ________________________________________________________________*/ #ifndef USER_MODE #define __NO_VERSION__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef KERNEL2_6 #include #endif #ifdef KERNEL2_4 #include #include #endif #endif #include "defs.h" #include "vars.h" extern MAC_RLC_XFACE* mac_rrc_register(RRC_XFACE*); extern int mac_rrc_unregister(RRC_XFACE *); extern void *bigphys_malloc(int); #ifndef USER_MODE /*------------------------------------------------*/ /* Prototypes */ /*------------------------------------------------*/ #ifdef KERNEL2_4 static int init_module( void ); static void cleanup_module(void); #else static int openair_rrc_init_module( void ); static void openair_rrc_cleanup_module(void); #endif #ifdef KERNEL2_6 static int __init openair_rrc_init_module( void ) #else int init_module( void ) #endif //KERNEL2_6 { printk("[OPENAIR][RRC][INIT] inserting module\n"); Rrc_xface = (RRC_XFACE*)malloc16(sizeof(RRC_XFACE)); if(Rrc_xface == NULL) { printk("[RRC] FATAL EROOR: Could not allocate memory for Rrc_xface !!!\n"); return (-1); } Mac_rlc_xface=mac_rrc_register(Rrc_xface); if( Mac_rlc_xface == NULL ) { printk("[OPENAIR][RRC][INIT] Could not get RRC descriptor\n"); return -1; } else { printk("[OPENAIR][RRC][INIT] Got RRC descriptor , Rcc_xface %p,Mac_rlc_xface=%p \n",Rrc_xface,Mac_rlc_xface); } if(rrc_init_global_param()==-1) { printk("[OPENAIR][RRC][INIT] FATAL ERROR: INIT_GLOBAL_PARAM_NOK\n"); return -1; } return 0; } #ifdef KERNEL2_6 static void __exit openair_rrc_cleanup_module(void) #else void cleanup_module(void) #endif //KERNEL2_6 { #ifndef NO_RRM rtf_destroy(RRC2RRM_FIFO); rtf_destroy(RRM2RRC_FIFO); #endif //NO_RRM printk("[OPENAIR][RRC][CLEANUP] cleanup module\n"); mac_rrc_unregister(Rrc_xface); } MODULE_AUTHOR ("Lionel GAUTHIER , Raymond KNOPP , Aawatif MENOUNI ,Dominique NUSSBAUM , Michelle WETTERWALD , Maxime GUILLAUD "); MODULE_DESCRIPTION ("openair RRC layer module"); MODULE_LICENSE ("GPL"); module_init (openair_rrc_init_module); module_exit (openair_rrc_cleanup_module); #endif //USER_MODE