Commit afcc9aab authored by Mongazon's avatar Mongazon
Browse files

Fix #582, USER_MODE flag removed

parent a2d16b34
......@@ -29,21 +29,7 @@
# @ingroup _openair2
*/
#ifdef USER_MODE
# include <inttypes.h>
#else
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
# ifndef PRIu64
# if __WORDSIZE == 64
# define PRIu64 "lu"
# else
# define PRIu64 "llu"
# endif
# endif
#endif
#include <inttypes.h>
#include "LAYER2/RLC/rlc.h"
#include "LAYER2/MAC/defs.h"
......@@ -404,11 +390,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
}
#ifdef PROC
#ifndef USER_MODE
static int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
#else
int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
#endif
{
int len = 0,fg,Overhead, Sign;
......@@ -691,36 +673,4 @@ int openair2_stats_read(char *buffer, char **my_buffer, off_t off, int length)
return len;
}
#ifndef USER_MODE
static struct proc_dir_entry *proc_openair2_root;
/*
* Initialize the module and add the /proc file.
*/
int add_openair2_stats()
{
struct proc_dir_entry *pde;
proc_openair2_root = proc_mkdir("openair2",0);
// pde = proc_create_entry("lchan_stats", S_IFREG | S_IRUGO, proc_openair2_root);
pde = proc_create_data("lchan_stats", S_IFREG | S_IRUGO, proc_openair2_root, NULL,openair2_stats_read);
if (!pde) {
printk("[OPENAIR][ERROR] can't create proc entry !\n");
}
return 0;
}
/*
* Unregister the file when the module is closed.
*/
void remove_openair_stats()
{
if (proc_openair2_root) {
printk("[OPENAIR][CLEANUP] Removing openair proc entry\n");
remove_proc_entry("lchan_stats", proc_openair2_root);
}
}
#endif
#endif
......@@ -27,55 +27,15 @@
________________________________________________________________*/
#ifndef USER_MODE
#define __NO_VERSION__
#else
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#endif
#include "COMMON/openair_types.h"
#include "MAC/extern.h"
#include <linux/module.h>
#ifndef USER_MODE
//-----------------------------------------------------------------------------------------------------------//
MAC_RLC_XFACE* mac_rrc_register(RRC_XFACE* RRC_xface)
{
//-----------------------------------------------------------------------------------------------------------//
if(Is_rrc_registered) {
msg("[OPENAIR][MAC][RRC_REGISTER] RRC interface already registered, aborting ...\n");
return NULL;
} else {
msg("[OPENAIR][MAC][RRC_REGISTER] Registering RRC Interface, Mac_rlc_xface=%p\n",Mac_rlc_xface);
Rrc_xface=RRC_xface;
Is_rrc_registered=1;
return Mac_rlc_xface;
}
}
//-----------------------------------------------------------------------------------------------------------//
int mac_rrc_unregister(RRC_XFACE *RRC_xface)
{
//-----------------------------------------------------------------------------------------------------------//
if (Rrc_xface == RRC_xface) {
msg("[OPENAIR][MAC XFACE][RRC_UNREGISTER] Unregistering RRC interface\n");
Rrc_xface=NULL;
Is_rrc_registered=0;
return(0);
} else {
msg("[OPENAIR][MAC XFACE][RRC_UNREGISTER] Not the right interface descriptor pointer!!!, aborting ...\n");
return (-1);
}
}
EXPORT_SYMBOL(mac_rrc_register);
EXPORT_SYMBOL(mac_rrc_unregister);
#endif //USER_MODE
......@@ -19,8 +19,8 @@ ASN1_DIR = $(OPENAIR2_DIR)
#GRAAL_DIR =$(UPDIR)/non_access_stratum/driver/nasmt
#RRC_DIR =$(UPDIR)/access_stratum/l3/rrc
#CFLAGS += -Wall -g -DDEBUG_RRC_STATE -DUSER_MODE -DNODE_RG -DNODE_MT
CFLAGS += -std=gnu99 -I$(KERNEL_DIR) -DUSER_MODE -DNB_ANTENNAS_RX=1
#CFLAGS += -Wall -g -DDEBUG_RRC_STATE -DNODE_RG -DNODE_MT
CFLAGS += -std=gnu99 -I$(KERNEL_DIR) -DNB_ANTENNAS_RX=1
ifdef CELL_RRM
CFLAGS += -DNODE_RG
......
......@@ -187,9 +187,6 @@ MACPHY_DATA_REQ *new_macphy_data_req(unsigned char Mod_id)
return((MACPHY_DATA_REQ*)0);
}
#ifndef USER_MODE
EXPORT_SYMBOL(new_macphy_data_req);
#endif
#endif //PHY_CONTEXT
......@@ -262,13 +259,7 @@ void macphy_data_ind(unsigned char Mod_id,unsigned char Pdu_type,void *pdu,unsig
}
}
msg("[OPENAIR][MAC][ERROR] No more PHY_RESOURCES !!!!\n");
#ifdef USER_MODE
exit(-1);
#else
print_active_indications();
print_active_requests();
mac_xface->macphy_exit();
#endif
}
*/
......
......@@ -42,7 +42,3 @@ unsigned int mac_registered;
#endif
#ifndef USER_MODE
EXPORT_SYMBOL(mac_xface);
#endif //PHY_EMUL
......@@ -28,45 +28,10 @@
* \email: navid.nikaein@eurecom.fr
*/
#ifdef USER_MODE
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#else //USER_MODE
#include <asm/io.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
#include <asm/segment.h>
#include <asm/page.h>
#include <asm/delay.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/slab.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/errno.h>
#ifdef KERNEL2_6
#include <linux/slab.h>
#endif
#ifdef KERNEL2_4
#include <linux/malloc.h>
#include <linux/wrapper.h>
#endif
#endif //USER_MODE
#include "platform_types.h"
#include "openair_defs.h"
......
......@@ -28,7 +28,6 @@
* \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr
*/
#ifdef USER_MODE
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h> /* for atoi(3) */
......@@ -36,14 +35,7 @@
#include <string.h> /* for strerror(3) */
#include <sysexits.h> /* for EX_* exit codes */
#include <errno.h> /* for errno */
#else
#include <linux/module.h> /* Needed by all modules */
#endif
#ifdef USER_MODE
//#include "RRC/LITE/defs.h"
//#include "COMMON/mac_rrc_primitives.h"
#include "UTIL/LOG/log.h"
#endif
#include <asn_application.h>
#include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */
#include <per_encoder.h>
......@@ -90,16 +82,8 @@
#include "common/ran_context.h"
//#include "PHY/defs.h"
#ifndef USER_MODE
#define msg printk
#ifndef errno
int errno;
#endif
#else
# if !defined (msg)
# define msg printf
# endif
#if !defined (msg)
#define msg printf
#endif
//#define XER_PRINT
......@@ -483,9 +467,7 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"[eNB] SystemInformationBlockType1 Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
if (enc_rval.encoded==-1) {
return(-1);
......@@ -1013,9 +995,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"[eNB] SystemInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : SI encoding failed for SIB23\n");
......@@ -1102,9 +1082,7 @@ uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv)
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"[UE] RRCConnectionRequest Encoded %zd bits (%zd bytes), ecause %d\n",enc_rval.encoded,(enc_rval.encoded+7)/8,ecause);
#endif
return((enc_rval.encoded+7)/8);
......@@ -1185,9 +1163,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"RRCConnectionSetupComplete Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
return((enc_rval.encoded+7)/8);
......@@ -1247,9 +1223,7 @@ do_RRCConnectionReconfigurationComplete(
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"RRCConnectionReconfigurationComplete Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
return((enc_rval.encoded+7)/8);
}
......@@ -1636,10 +1610,8 @@ do_RRCConnectionSetup(
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"RRCConnectionSetup Encoded %zd bits (%zd bytes), ecause %d\n",
enc_rval.encoded,(enc_rval.encoded+7)/8,ecause);
#endif
// FREEMEM(SRB_list);
// free(SRB1_config);
......@@ -1709,13 +1681,11 @@ do_SecurityModeCommand(
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"[eNB %d] securityModeCommand for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
#endif
if (enc_rval.encoded==-1) {
LOG_E(RRC,"[eNB %d] ASN1 : securityModeCommand encoding failed for UE %x\n",
......@@ -1787,13 +1757,11 @@ do_UECapabilityEnquiry(
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"[eNB %d] UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rnti,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
#endif
if (enc_rval.encoded==-1) {
LOG_E(RRC,"[eNB %d] ASN1 : UECapabilityRequest encoding failed for UE %x\n",
......@@ -1953,13 +1921,11 @@ do_RRCConnectionReconfiguration(
# endif
#endif
//#ifdef USER_MODE
LOG_I(RRC,"RRCConnectionReconfiguration Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
// for (i=0;i<30;i++)
// msg("%x.",buffer[i]);
// msg("\n");
//#endif
return((enc_rval.encoded+7)/8);
}
......@@ -2014,10 +1980,8 @@ do_RRCConnectionReestablishmentReject(
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"RRCConnectionReestablishmentReject Encoded %zd bits (%zd bytes)\n",
enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
return((enc_rval.encoded+7)/8);
}
......@@ -2075,10 +2039,8 @@ do_RRCConnectionReject(
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"RRCConnectionReject Encoded %zd bits (%zd bytes)\n",
enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
return((enc_rval.encoded+7)/8);
}
......@@ -2266,9 +2228,7 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id,
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"[eNB] MCCH Message Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
if (enc_rval.encoded==-1) {
msg("[RRC] ASN1 : MCCH encoding failed for MBSFNAreaConfiguration\n");
......@@ -2400,9 +2360,7 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
# endif
#endif
#ifdef USER_MODE
printf("Measurement Report Encoded %zu bits (%zu bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
return((enc_rval.encoded+7)/8);
}
......
......@@ -28,7 +28,6 @@
* \email: raymond.knopp@eurecom.fr and navid.nikaein@eurecom.fr
*/
#ifdef USER_MODE
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h> /* for atoi(3) */
......@@ -36,9 +35,6 @@
#include <string.h> /* for strerror(3) */
#include <sysexits.h> /* for EX_* exit codes */
#include <errno.h> /* for errno */
#else
#include <linux/module.h> /* Needed by all modules */
#endif
#include <asn_application.h>
#include <asn_internal.h> /* for _ASN_DEFAULT_STACK_MAX */
......
......@@ -31,11 +31,9 @@
#ifndef __OPENAIR_RRC_DEFS_H__
#define __OPENAIR_RRC_DEFS_H__
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
#include "collection/tree.h"
#include "rrc_types.h"
......@@ -47,11 +45,6 @@
#include "LAYER2/MAC/defs.h"
//#include "COMMON/openair_defs.h"
#ifndef USER_MODE
#include <rtai.h>
#endif
#include "SystemInformationBlockType1.h"
#include "SystemInformation.h"
#include "RRCConnectionReconfiguration.h"
......
......@@ -27,41 +27,6 @@
________________________________________________________________*/
#ifndef USER_MODE
#define __NO_VERSION__
#include <asm/io.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
#include <asm/segment.h>
#include <asm/page.h>
#include <asm/delay.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/slab.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/errno.h>
#ifdef KERNEL2_6
#include <linux/slab.h>
#endif
#ifdef KERNEL2_4
#include <linux/malloc.h>
#include <linux/wrapper.h>
#endif
#endif
#include "defs.h"
#include "vars.h"
......@@ -72,75 +37,3 @@ 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 <lionel.gauthier@eurecom.fr>, Raymond KNOPP <raymond.knopp@eurecom.fr>, Aawatif MENOUNI <aawatif.menouni@eurecom.fr>,Dominique NUSSBAUM <dominique.nussbaum@eurecom.fr>, Michelle WETTERWALD <michelle.wetterwald@eurecom.fr>, Maxime GUILLAUD <maxime.guillaud@eurecom.fr, Hicham ANOUAR <hicham.anouar@eurecom.fr>");
MODULE_DESCRIPTION ("openair RRC layer module");
MODULE_LICENSE ("GPL");
module_init (openair_rrc_init_module);
module_exit (openair_rrc_cleanup_module);
#endif //USER_MODE
......@@ -66,10 +66,8 @@
#include "OCG.h"
#include "OCG_extern.h"
#endif
#ifdef USER_MODE
#include "RRC/NAS/nas_config.h"
#include "RRC/NAS/rb_config.h"
#endif
#if ENABLE_RAL
#include "rrc_UE_ral.h"
#endif
......@@ -1730,9 +1728,7 @@ rrc_ue_process_securityModeCommand(
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC, "securityModeComplete Encoded %zd bits (%zd bytes)\n", enc_rval.encoded, (enc_rval.encoded+7)/8);
#endif
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
LOG_T(RRC, "%02x.", buffer[i]);
......@@ -1835,9 +1831,7 @@ rrc_ue_process_ueCapabilityEnquiry(
# endif
#endif
#ifdef USER_MODE
LOG_D(RRC,"UECapabilityInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
#endif
for (i = 0; i < (enc_rval.encoded + 7) / 8; i++) {
LOG_T(RRC, "%02x.", buffer[i]);
......@@ -4246,10 +4240,6 @@ static void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_i
#endif // rel10
#ifndef USER_MODE
EXPORT_SYMBOL(Rlc_info_am_config);
#endif
#if defined(ENABLE_ITTI)
//-----------------------------------------------------------------------------
void *rrc_ue_task( void *args_p )
......
......@@ -97,9 +97,7 @@ rrc_init_global_param(
//-----------------------------------------------------------------------------
{
//#ifdef USER_MODE
// Rrc_xface = (RRC_XFACE*)malloc16(sizeof(RRC_XFACE));
//#endif //USRE_MODE
// Rrc_xface->openair_rrc_top_init = openair_rrc_top_init;
// Rrc_xface->openair_rrc_eNB_init = openair_rrc_eNB_init;
......
......@@ -63,12 +63,10 @@
#include "MeasResults.h"
//#endif
#ifdef USER_MODE
# include "RRC/NAS/nas_config.h"
# include "RRC/NAS/rb_config.h"
# include "OCG.h"
# include "OCG_extern.h"
#endif
#include "RRC/NAS/nas_config.h"
#include "RRC/NAS/rb_config.h"
#include "OCG.h"
#include "OCG_extern.h"
#if defined(ENABLE_SECURITY)
# include "UTIL/OSA/osa_defs.h"
......
......@@ -292,10 +292,5 @@ int send_msg_fifo(int *s, msg_t *fmsg)
int send_msg(void *s, msg_t *smsg)
{
#ifdef USER_MODE