Commit f6e664af authored by Lionel Gauthier's avatar Lionel Gauthier

Modified ETHERNET DRIVER: deleted the classifier, classification is done by...

Modified ETHERNET DRIVER: deleted the classifier, classification is done by marking. Changed netlink reading code in pdcp_fifo.c

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4007 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent d44ccd24
......@@ -16,12 +16,19 @@
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#define MAX_PAYLOAD 4096 /* this sould cover the max mtu size*/
#include <errno.h>
#include "platform_constants.h"
char nl_rx_buf[NL_MAX_PAYLOAD];
struct sockaddr_nl nas_src_addr, nas_dest_addr;
struct nlmsghdr *nas_nlh = NULL;
struct iovec nas_iov;
struct nlmsghdr *nas_nlh_tx = NULL;
struct nlmsghdr *nas_nlh_rx = NULL;
struct iovec nas_iov_tx;
struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
int nas_sock_fd;
struct msghdr nas_msg;
struct msghdr nas_msg_tx;
struct msghdr nas_msg_rx;
#define GRAAL_NETLINK_ID 31
......@@ -39,36 +46,57 @@ int netlink_init(void)
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
printf("[NETLINK] fcntl returns %d\n",ret);
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd, (struct sockaddr *)&nas_src_addr,
sizeof(nas_src_addr));
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
if (nas_sock_fd==-1) {
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
exit(1);
}
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
printf("[NETLINK] bind returns %d\n",ret);
if (ret == -1) {
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
exit(1);
}
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
nas_src_addr.nl_family = AF_NETLINK;
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
nas_src_addr.nl_groups = 0; /* not in mcast groups */
ret = bind(nas_sock_fd, (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
nas_nlh=(struct nlmsghdr *)malloc(NLMSG_SPACE(MAX_PAYLOAD));
/* Fill the netlink message header */
nas_nlh->nlmsg_len = NLMSG_SPACE(MAX_PAYLOAD);
nas_nlh->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh->nlmsg_flags = 0;
nas_iov.iov_base = (void *)nas_nlh;
nas_iov.iov_len = nas_nlh->nlmsg_len;
memset(&nas_msg,0,sizeof(nas_msg));
nas_msg.msg_name = (void *)&nas_dest_addr;
nas_msg.msg_namelen = sizeof(nas_dest_addr);
nas_msg.msg_iov = &nas_iov;
nas_msg.msg_iovlen = 1;
/* Read message from kernel */
memset(nas_nlh, 0, NLMSG_SPACE(MAX_PAYLOAD));
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
nas_dest_addr.nl_family = AF_NETLINK;
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
nas_dest_addr.nl_groups = 0; /* unicast */
// TX PART
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
/* Fill the netlink message header */
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
nas_nlh_tx->nlmsg_flags = 0;
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
nas_msg_tx.msg_name = (void *)&nas_dest_addr;
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
nas_msg_tx.msg_iov = &nas_iov_tx;
nas_msg_tx.msg_iovlen = 1;
// RX PART
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
nas_msg_rx.msg_name = (void *)&nas_src_addr;
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
nas_msg_rx.msg_iov = &nas_iov_rx;
nas_msg_rx.msg_iovlen = 1;
return(nas_sock_fd);
}
......@@ -12,14 +12,16 @@
#ifndef __PLATFORM_CONSTANTS_H__
# define __PLATFORM_CONSTANTS_H__
#define NL_MAX_PAYLOAD 4096 /* this should cover the max mtu size*/
#ifdef USER_MODE
#ifdef LARGE_SCALE
#ifdef LARGE_SCALE
# define NB_MODULES_MAX 128
# define NB_NODE_MAX 128
#else
# define NB_MODULES_MAX 32
# define NB_NODE_MAX 32
#endif
#endif
#else
# define NB_MODULES_MAX 1
# define NB_NODE_MAX 1
......@@ -31,22 +33,23 @@
#else
# define MAX_IP_PACKET_SIZE 1500
#endif
// overwrite the previous deinitions
// overwrite the previous deinitions
# define MAX_MODULES NB_MODULES_MAX
#ifdef LARGE_SCALE
#ifdef LARGE_SCALE
# define MAX_MOBILES_PER_RG 128
# define MAX_RG 2
#else
#else
# define MAX_MOBILES_PER_RG 16
# define MAX_RG 2
#endif
# define MAX_MANAGED_RG_PER_MOBILE 2
# define DEFAULT_RAB_ID 3
# define NB_RB_MAX 11
# define NB_RAB_MAX 8 // 4
# define NB_RAB_MAX 8 // 4
# define RAB_SHIFT1 9
# define RAB_SHIFT2 3
# define RAB_OFFSET 0x0007
......@@ -54,8 +57,8 @@
# define RAB_OFFSET2 0x01F8
# define DIR_OFFSET 0x8000
# define DIR_SHIFT 15
# define CH_OFFSET 0x0004
# define CH_SHIFT 2
# define CH_OFFSET 0x0004
# define CH_SHIFT 2
#ifdef MESH
# define MAX_RB_MOBILE NB_RB_MAX * ( MAX_MANAGED_RG_PER_MOBILE + MAX_MOBILES_PER_RG - 1 )
......@@ -111,7 +114,7 @@
# define DELIVERY_OF_ERRONEOUS_SDU_NO_DETECT 2
// CBA constant
// CBA constant
#define NUM_MAX_CBA_GROUP 4
# ifndef __cplusplus
......
......@@ -72,6 +72,7 @@
#endif //NON_ACCESS_STRATUM
//-----------------------------------------------------------------------------
#include "COMMON/platform_constants.h"
#include "COMMON/platform_types.h"
#include "DRB-ToAddMod.h"
#include "DRB-ToAddModList.h"
#include "SRB-ToAddMod.h"
......@@ -97,15 +98,15 @@ public_pdcp(unsigned int Pdcp_stats_rx_rate[NB_MODULES_MAX][NB_CNX_CH][NB_RAB_MA
typedef struct pdcp_t {
BOOL instanciated_instance;
u16 header_compression_profile;
u8 cipheringAlgorithm;
u8 integrityProtAlgorithm;
u8 rlc_mode;
u8 rlc_mode;
u8 status_report;
u8 seq_num_size;
u8 lcid;
u8 lcid;
/*
* Sequence number state variables
*
......@@ -138,12 +139,12 @@ typedef struct pdcp_t {
typedef struct pdcp_mbms_t {
BOOL instanciated_instance;
uint16_t service_id;
uint16_t service_id;
uint32_t session_id; // lcid
uint16_t rb_id;
uint16_t rb_id;
} pdcp_mbms_t;
/*
* Following symbolic constant alters the behaviour of PDCP
......@@ -196,11 +197,11 @@ public_pdcp(BOOL pdcp_data_ind (module_id_t module_id, u32_t frame, u8_t eNB_fla
* \param[in] frame Frame number
* \param[in] Shows if relevant PDCP entity is part of an eNB or a UE
* \param[in] rab_id Radio Bearer ID
* \param[in] muiP
* \param[in] muiP
* \param[in] confirmP
* \param[in] sdu_buffer_size Size of incoming SDU in bytes
* \param[in] sdu_buffer Buffer carrying SDU
* \param[in] mode flag to indicate whether the userplane data belong to the control plane or data plane or transparent
* \param[in] mode flag to indicate whether the userplane data belong to the control plane or data plane or transparent
* \return TRUE on success, FALSE otherwise
* \note None
* @ingroup _pdcp
......@@ -228,14 +229,14 @@ public_pdcp(BOOL pdcp_data_ind (module_id_t module_id, u32_t frame, u8_t eNB_fla
/*! \fn void rrc_pdcp_config_req(module_id_t, rb_id_t,u8)
* \brief This functions initializes relevant PDCP entity
* \param[in] module_id Module ID of relevant PDCP entity
* \param[in] frame frame counter (TTI)
* \param[in] frame frame counter (TTI)
* \param[in] eNB_flag flag indicating the node type
* \param[in] action flag for action: add, remove , modify
* \param[in] rab_id Radio Bearer ID of relevant PDCP entity
* \return none
* \note None
* @ingroup _pdcp
*/
*/
public_pdcp(void rrc_pdcp_config_req (module_id_t module_id, u32 frame, u8_t eNB_flag, u32 action, rb_id_t rab_id, u8 security_mode);)
......@@ -322,7 +323,7 @@ typedef struct pdcp_data_ind_header_t {
#if 0
/*
* Missing PDU information struct, a copy of this will be enqueued
* Missing PDU information struct, a copy of this will be enqueued
* into pdcp.missing_pdus for every missing PDU
*/
typedef struct pdcp_missing_pdu_info_t {
......
This diff is collapsed.
......@@ -40,40 +40,43 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
void rlc_am_check_timer_status_prohibit(rlc_am_entity_t *rlcP,u32_t frame)
//-----------------------------------------------------------------------------
{
if (rlcP->t_status_prohibit.running) {
if (
// CASE 1: start time out
// +-----------+------------------+----------+
// | |******************| |
// +-----------+------------------+----------+
//FRAME # 0 FRAME MAX
((rlcP->t_status_prohibit.frame_start < rlcP->t_status_prohibit.frame_time_out) &&
((frame >= rlcP->t_status_prohibit.frame_time_out) ||
(frame < rlcP->t_status_prohibit.frame_start))) ||
// CASE 2: time out start
// +-----------+------------------+----------+
// |***********| |**********|
// +-----------+------------------+----------+
//FRAME # 0 FRAME MAX VALUE
((rlcP->t_status_prohibit.frame_start > rlcP->t_status_prohibit.frame_time_out) &&
(frame < rlcP->t_status_prohibit.frame_start) && (frame >= rlcP->t_status_prohibit.frame_time_out))
) {
if (rlcP->t_status_prohibit.time_out > 0) {
if (rlcP->t_status_prohibit.running) {
if (
// CASE 1: start time out
// +-----------+------------------+----------+
// | |******************| |
// +-----------+------------------+----------+
//FRAME # 0 FRAME MAX
((rlcP->t_status_prohibit.frame_start < rlcP->t_status_prohibit.frame_time_out) &&
((frame >= rlcP->t_status_prohibit.frame_time_out) ||
(frame < rlcP->t_status_prohibit.frame_start))) ||
// CASE 2: time out start
// +-----------+------------------+----------+
// |***********| |**********|
// +-----------+------------------+----------+
//FRAME # 0 FRAME MAX VALUE
((rlcP->t_status_prohibit.frame_start > rlcP->t_status_prohibit.frame_time_out) &&
(frame < rlcP->t_status_prohibit.frame_start) && (frame >= rlcP->t_status_prohibit.frame_time_out))
) {
//if ((rlcP->t_status_prohibit.frame_time_out <= frame) && (rlcP->t_status_prohibit.frame_start)) {
rlcP->t_status_prohibit.running = 0;
rlcP->t_status_prohibit.timed_out = 1;
rlcP->stat_timer_status_prohibit_timed_out += 1;
//if ((rlcP->t_status_prohibit.frame_time_out <= frame) && (rlcP->t_status_prohibit.frame_start)) {
rlcP->t_status_prohibit.running = 0;
rlcP->t_status_prohibit.timed_out = 1;
rlcP->stat_timer_status_prohibit_timed_out += 1;
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][T-STATUS-PROHIBIT] TIME-OUT\n", frame,
rlcP->module_id, rlcP->rb_id);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RLC_AM][MOD %02d][RB %02d][--- t-StatusProhibit Timed-out --->][RLC_AM][MOD %02d][RB %02d]\n",
frame,
rlcP->module_id,
rlcP->rb_id,
rlcP->module_id,
rlcP->rb_id);
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][T-STATUS-PROHIBIT] TIME-OUT\n", frame,
rlcP->module_id, rlcP->rb_id);
LOG_D(RLC, "[MSC_MSG][FRAME %05d][RLC_AM][MOD %02d][RB %02d][--- t-StatusProhibit Timed-out --->][RLC_AM][MOD %02d][RB %02d]\n",
frame,
rlcP->module_id,
rlcP->rb_id,
rlcP->module_id,
rlcP->rb_id);
#warning TO DO rlc_am_check_timer_status_prohibit
rlcP->t_status_prohibit.frame_time_out = frame + rlcP->t_status_prohibit.time_out;
rlc_am_stop_and_reset_timer_status_prohibit(rlcP, frame);
//rlcP->t_status_prohibit.frame_time_out = frame + rlcP->t_status_prohibit.time_out;
}
}
}
}
......@@ -81,23 +84,27 @@ void rlc_am_check_timer_status_prohibit(rlc_am_entity_t *rlcP,u32_t frame)
void rlc_am_stop_and_reset_timer_status_prohibit(rlc_am_entity_t *rlcP,u32_t frame)
//-----------------------------------------------------------------------------
{
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][T-STATUS-PROHIBIT] STOPPED AND RESET\n", frame,
if (rlcP->t_status_prohibit.time_out > 0) {
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][T-STATUS-PROHIBIT] STOPPED AND RESET\n", frame,
rlcP->module_id, rlcP->rb_id);
rlcP->t_status_prohibit.running = 0;
rlcP->t_status_prohibit.frame_time_out = 0;
rlcP->t_status_prohibit.frame_start = 0;
rlcP->t_status_prohibit.timed_out = 0;
rlcP->t_status_prohibit.running = 0;
rlcP->t_status_prohibit.frame_time_out = 0;
rlcP->t_status_prohibit.frame_start = 0;
rlcP->t_status_prohibit.timed_out = 0;
}
}
//-----------------------------------------------------------------------------
void rlc_am_start_timer_status_prohibit(rlc_am_entity_t *rlcP,u32_t frame)
//-----------------------------------------------------------------------------
{
rlcP->t_status_prohibit.running = 1;
rlcP->t_status_prohibit.frame_time_out = rlcP->t_status_prohibit.time_out + frame;
rlcP->t_status_prohibit.frame_start = frame;
rlcP->t_status_prohibit.timed_out = 0;
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][T-STATUS-PROHIBIT] STARTED (TIME-OUT = FRAME %05d)\n", frame, rlcP->module_id, rlcP->rb_id, rlcP->t_status_prohibit.frame_time_out);
LOG_D(RLC, "TIME-OUT = FRAME %05d\n", rlcP->t_status_prohibit.frame_time_out);
if (rlcP->t_status_prohibit.time_out > 0) {
rlcP->t_status_prohibit.running = 1;
rlcP->t_status_prohibit.frame_time_out = rlcP->t_status_prohibit.time_out + frame;
rlcP->t_status_prohibit.frame_start = frame;
rlcP->t_status_prohibit.timed_out = 0;
LOG_D(RLC, "[FRAME %05d][RLC_AM][MOD %02d][RB %02d][T-STATUS-PROHIBIT] STARTED (TIME-OUT = FRAME %05d)\n", frame, rlcP->module_id, rlcP->rb_id, rlcP->t_status_prohibit.frame_time_out);
LOG_D(RLC, "TIME-OUT = FRAME %05d\n", rlcP->t_status_prohibit.frame_time_out);
}
}
//-----------------------------------------------------------------------------
void rlc_am_init_timer_status_prohibit(rlc_am_entity_t *rlcP, u32_t time_outP)
......
......@@ -171,7 +171,6 @@ typedef struct {
#define RLC_MAX_LC ((max_val_DRB_Identity+1)* MAX_MOBILES_PER_RG)
#endif
protected_rlc(void (*rlc_rrc_data_ind) (module_id_t , u32_t, u8_t, rb_id_t , sdu_size_t , char* );)
protected_rlc(void (*rlc_rrc_data_conf) (module_id_t , rb_id_t , mui_t, rlc_tx_status_t );)
......
......@@ -268,7 +268,13 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t module_idP, u32_t frameP, u
mbms_session = pmch_info_r9->mbms_SessionInfoList_r9.list.array[cnt2];
if (mbms_session->logicalChannelIdentity_r9 > 0) {
lc_id = (NUMBER_OF_UE_MAX*NB_RB_MAX) + mbms_session->logicalChannelIdentity_r9;
//lc_id = (NUMBER_OF_UE_MAX*NB_RB_MAX) + mbms_session->logicalChannelIdentity_r9;
if (eNB_flagP) {
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3) * MAX_MOBILES_PER_RG;
} else {
lc_id = mbms_session->logicalChannelIdentity_r9 + (maxDRB + 3);
}
if (mbms_session->sessionId_r9 != NULL) {
mbms_session_id = mbms_session->sessionId_r9->buf[0];
......
......@@ -119,7 +119,7 @@ remove_emul:
clean_nasmesh:
(cd NAS/DRIVER/MESH && $(MAKE) V=1 -C /usr/src/linux M=`pwd` clean)
(cd NAS/DRIVER/MESH && $(MAKE) V=1 -C /usr/src/linux M=`pwd` clean)
nasmesh_address_fix.ko:
(cd NAS/DRIVER/MESH && $(MAKE) -j$(NUM_CORES) $(SET_UM) V=1 ADDRESS_FIX=1 -C /usr/src/linux M=`pwd`)
......
......@@ -10,62 +10,64 @@ export KERNEL_MAIN_TYPE
KERNEL_MAIN_VERSION=$(shell echo `uname -r | cut -d. -f-1`)
ifeq ($(IS_LINUX), 1)
SUBVERSION=$(shell echo `grep '^SUBLEVEL =' /usr/src/linux/Makefile | sed -e 's, ,,g' | sed -e 's/SUBLEVEL=//'`)
PATCHLEVEL=$(shell echo `grep '^PATCHLEVEL =' /usr/src/linux/Makefile | sed -e 's, ,,g' | sed -e 's/PATCHLEVEL=//'`)
SUBLEVEL=$(shell echo `grep '^SUBLEVEL =' /usr/src/linux/Makefile | sed -e 's, ,,g' | sed -e 's/SUBLEVEL=//'`)
else
ifeq ($(IS_KERNEL_OPENAIRINTERFACE), 1)
SUBVERSION=$(shell echo `grep '^SUBLEVEL =' /usr/src/linux-$(KERNEL_NAME)/Makefile | sed -e 's, ,,g' | sed -e 's/SUBLEVEL=//'`)
PATCHLEVEL=$(shell echo `grep '^PATCHLEVEL =' /usr/src/linux-$(KERNEL_NAME)/Makefile | sed -e 's, ,,g' | sed -e 's/PATCHLEVEL=//'`)
SUBLEVEL=$(shell echo `grep '^SUBLEVEL =' /usr/src/linux-$(KERNEL_NAME)/Makefile | sed -e 's, ,,g' | sed -e 's/SUBLEVEL=//'`)
else
SUBVERSION=$(shell echo `grep '^SUBLEVEL =' /usr/src/linux-headers-$(KERNEL_NAME)/Makefile | sed -e 's, ,,g' | sed -e 's/SUBLEVEL=//'`)
PATCHLEVEL=$(shell echo `grep '^PATCHLEVEL =' /usr/src/linux-headers-$(KERNEL_NAME)/Makefile | sed -e 's, ,,g' | sed -e 's/PATCHLEVEL=//'`)
SUBLEVEL=$(shell echo `grep '^SUBLEVEL =' /usr/src/linux-headers-$(KERNEL_NAME)/Makefile | sed -e 's, ,,g' | sed -e 's/SUBLEVEL=//'`)
endif
endif
ifeq ($(KERNEL_MAIN_VERSION),2)
ifeq ($(PATCHLEVEL),6)
IS_KERNEL_GREATER_THAN_2620=$(shell if [ $(SUBLEVEL) -ge 20 ] ; then echo true ; fi)
IS_KERNEL_GREATER_THAN_2622=$(shell if [ $(SUBLEVEL) -ge 22 ] ; then echo true ; fi)
IS_KERNEL_GREATER_THAN_2629=$(shell if [ $(SUBLEVEL) -ge 29 ] ; then echo true ; fi)
IS_KERNEL_GREATER_THAN_2630=$(shell if [ $(SUBLEVEL) -ge 30 ] ; then echo true ; fi)
IS_KERNEL_GREATER_THAN_2632=$(shell if [ $(SUBLEVEL) -ge 32 ] ; then echo true ; fi)
IS_KERNEL_MAIN_VERSION_IS_3 = "false"
IS_KERNEL_GREATER_THAN_32 = "false"
IS_KERNEL_GREATER_THAN_35 = "false"
endif
else
ifeq ($(KERNEL_MAIN_VERSION),3)
IS_KERNEL_GREATER_THAN_2622 = "true"
IS_KERNEL_GREATER_THAN_2629 = "true"
IS_KERNEL_GREATER_THAN_2630 = "true"
IS_KERNEL_GREATER_THAN_2632 = "true"
IS_KERNEL_MAIN_VERSION_IS_3 = "true"
IS_KERNEL_GREATER_THAN_32=$(shell if [ $(PATCHLEVEL) -ge 2 ] ; then echo true ; fi)
IS_KERNEL_GREATER_THAN_35=$(shell if [ $(PATCHLEVEL) -ge 5 ] ; then echo true ; fi)
endif
endif
IS_KERNEL_SUBVERSION_GREATER_THAN_20=$(shell if [ $(SUBVERSION) -ge 20 ] ; then echo true ; fi)
KERNEL_ARCH=$(shell echo `uname -m`)
#SET_REGPARM=$(shell if [ $(KERNEL_ARCH) = 'i686' -a $(SUBVERSION) -ge 20 ]; then echo true ; fi)
SET_X64=$(shell if [ $(KERNEL_ARCH) = 'x86_64' -a $(SUBVERSION) -ge 20 ]; then echo true ; fi)
IS_KERNEL_SUBVERSION_GREATER_THAN_22=$(shell if [ $(SUBVERSION) -ge 22 ] ; then echo true ; fi)
IS_KERNEL_SUBVERSION_GREATER_THAN_29=$(shell if [ $(SUBVERSION) -ge 29 ] ; then echo true ; fi)
IS_KERNEL_SUBVERSION_GREATER_THAN_30=$(shell if [ $(SUBVERSION) -ge 30 ] ; then echo true ; fi)
IS_KERNEL_SUBVERSION_GREATER_THAN_32=$(shell if [ $(SUBVERSION) -ge 32 ] ; then echo true ; fi)
# Add global rule for V3 kernels
ifeq ($(KERNEL_MAIN_VERSION),3)
IS_KERNEL_SUBVERSION_GREATER_THAN_22 = "true"
IS_KERNEL_SUBVERSION_GREATER_THAN_29 = "true"
IS_KERNEL_SUBVERSION_GREATER_THAN_30 = "true"
IS_KERNEL_SUBVERSION_GREATER_THAN_32 = "true"
IS_KERNEL_MAIN_VERSION_IS_3 = "true"
endif
SET_X64=$(shell if [ $(KERNEL_ARCH) = 'x86_64' ]; then echo true ; fi)
GT2622= $(if $(IS_KERNEL_SUBVERSION_GREATER_THAN_22),-DKERNEL_VERSION_GREATER_THAN_2622=1)
GT2629= $(if $(IS_KERNEL_SUBVERSION_GREATER_THAN_29),-DKERNEL_VERSION_GREATER_THAN_2629=1)
GT32= $(if $(IS_KERNEL_SUBVERSION_GREATER_THAN_32),-DKERNEL_VERSION_GREATER_THAN_32=1)
GT2622= $(if $(IS_KERNEL_GREATER_THAN_2622),-DKERNEL_VERSION_GREATER_THAN_2622=1)
GT2629= $(if $(IS_KERNEL_GREATER_THAN_2629),-DKERNEL_VERSION_GREATER_THAN_2629=1)
GT2632= $(if $(IS_KERNEL_GREATER_THAN_2632),-DKERNEL_VERSION_GREATER_THAN_2632=1)
GT32= $(if $(IS_KERNEL_GREATER_THAN_32),-DKERNEL_VERSION_GREATER_THAN_32=1)
GT35= $(if $(IS_KERNEL_GREATER_THAN_35),-DKERNEL_VERSION_GREATER_THAN_35=1)
V3= $(if $(IS_KERNEL_MAIN_VERSION_IS_3),-DKERNEL_MAIN_VERSION_IS_3=1)
####################################################
# NASMESH compilation flags
####################################################
#RTAI=1
####################################################
# D E B U G F L A G S
####################################################
####################################################
# EXTRA COMPILER FLAGS
####################################################
EXTRA_CFLAGS = -fno-common $(if $(IS_KERNEL_SUBVERSION_GREATER_THAN_20),-mregparm=3 -fno-stack-protector -mpreferred-stack-boundary=4) $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,) $(GT2622) $(GT2629) $(V3) $(GT32)
EXTRA_CFLAGS = -fno-common $(if $(IS_KERNEL_GREATER_THAN_2620),-mregparm=3 -fno-stack-protector -mpreferred-stack-boundary=4) $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,) $(GT2622) $(GT2629) $(V3) $(GT32) $(GT35)
ifdef ADDRCONF
EXTRA_CFLAGS += -DADDRCONF
endif
ifdef OAI_NW_DRIVER_TYPE_ETHERNET
EXTRA_CFLAGS += -DOAI_NW_DRIVER_TYPE_ETHERNET
EXTRA_CFLAGS += -DOAI_NW_DRIVER_TYPE_ETHERNET
endif
ifdef OAI_NW_DRIVER_USE_NETLINK
......@@ -90,7 +92,7 @@ obj-m += oai_nw_drv.o
oai_nw_drv-objs += device.o
oai_nw_drv-objs += common.o
oai_nw_drv-objs += ioctl.o
oai_nw_drv-objs += classifier.o
#oai_nw_drv-objs += classifier.o
oai_nw_drv-objs += tool.o
ifdef OAI_NW_DRIVER_USE_NETLINK
oai_nw_drv-objs += netlink.o
......@@ -113,6 +115,8 @@ print:
@echo linux kernel ge 29: $(IS_KERNEL_SUBVERSION_GREATER_THAN_29)
@echo flag gt2629: $(GT2629)
@echo linux kernel ge 30: $(IS_KERNEL_SUBVERSION_GREATER_THAN_30)
@echo linux kernel ge 32: $(IS_KERNEL_SUBVERSION_GREATER_THAN_32)
@echo linux kernel ge 35: $(IS_KERNEL_SUBVERSION_GREATER_THAN_35)
@echo flag KERNEL_MAIN_VERSION $(KERNEL_MAIN_VERSION)
clean:
rm -f *.ko
......
This diff is collapsed.
This diff is collapsed.
......@@ -180,7 +180,6 @@ int oai_nw_drv_stop(struct net_device *dev){
//---------------------------------------------------------------------------
void oai_nw_drv_teardown(struct net_device *dev){
//---------------------------------------------------------------------------
int cxi;
struct oai_nw_drv_priv *priv;
int inst;
......@@ -192,12 +191,12 @@ void oai_nw_drv_teardown(struct net_device *dev){
printk("[OAI_IP_DRV][%s] ERROR, couldn't find instance\n", __FUNCTION__);
return;
}
oai_nw_drv_class_flush_recv_classifier(priv);
/*oai_nw_drv_class_flush_recv_classifier(priv);
for (cxi=0;cxi<OAI_NW_DRV_CX_MAX;cxi++) {
oai_nw_drv_common_flush_rb(priv->cx+cxi);
oai_nw_drv_class_flush_send_classifier(priv->cx+cxi);
}
}*/
printk("[OAI_IP_DRV][%s] End\n", __FUNCTION__);
} // check dev
else {
......@@ -248,7 +247,7 @@ int oai_nw_drv_hard_start_xmit(struct sk_buff *skb, struct net_device *dev){
#ifdef OAI_DRV_DEBUG_DEVICE
printk("[OAI_IP_DRV][%s] step 1\n", __FUNCTION__);
#endif
oai_nw_drv_class_send(skb,inst);
oai_nw_drv_common_ip2wireless(skb,inst);
#ifdef OAI_DRV_DEBUG_DEVICE
printk("[OAI_IP_DRV][%s] step 2\n", __FUNCTION__);
#endif
......@@ -335,7 +334,7 @@ static const struct net_device_ops nasmesh_netdev_ops = {
// Initialisation of the network device
void oai_nw_drv_init(struct net_device *dev){
//---------------------------------------------------------------------------
u8 cxi, dscpi;
u8 cxi;
struct oai_nw_drv_priv *priv;
int index;
......@@ -385,7 +384,7 @@ void oai_nw_drv_init(struct net_device *dev){
//341 dev->tx_queue_len = 1000; /* Ethernet wants good queues */
//342 dev->flags = IFF_BROADCAST|IFF_MULTICAST;
//343 dev->priv_flags |= IFF_TX_SKB_SHARING;
//344
//344
//345 memset(dev->broadcast, 0xFF, ETH_ALEN);
//346 }
ether_setup(dev);
......@@ -416,10 +415,10 @@ void oai_nw_drv_init(struct net_device *dev){
// priv->timer_establishment=TIMER_ESTABLISHMENT_DEFAULT;
// priv->timer_release=TIMER_RELEASE_DEFAULT;
for (dscpi=0; dscpi<OAI_NW_DRV_DSCP_MAX; ++dscpi) {
/*for (dscpi=0; dscpi<OAI_NW_DRV_DSCP_MAX; ++dscpi) {
priv->rclassifier[dscpi]=NULL;
}
priv->nrclassifier=0;
priv->nrclassifier=0;*/
//
for (cxi=0;cxi<OAI_NW_DRV_CX_MAX;cxi++) {
#ifdef OAI_DRV_DEBUG_DEVICE
......@@ -432,7 +431,7 @@ void oai_nw_drv_init(struct net_device *dev){
priv->cx[cxi].countimer = OAI_NW_DRV_TIMER_IDLE;
priv->cx[cxi].retry = 0;
priv->cx[cxi].lcr = cxi;
priv->cx[cxi].rb = NULL;
/*priv->cx[cxi].rb = NULL;
priv->cx[cxi].num_rb = 0;
// initialisation of the classifier
for (dscpi=0; dscpi<65; ++dscpi) {
......@@ -442,6 +441,7 @@ void oai_nw_drv_init(struct net_device *dev){
priv->cx[cxi].nsclassifier=0;
priv->cx[cxi].nfclassifier=0;
*/
// initialisation of the IP address
oai_nw_drv_TOOL_eNB_imei2iid(oai_nw_drv_IMEI, (u8 *)priv->cx[cxi].iid6, dev->addr_len);
priv->cx[cxi].iid4=0;
......@@ -628,10 +628,3 @@ MODULE_PARM_DESC(oai_nw_drv_is_clusterhead,"The Clusterhead Indicator");
//MODULE_VERSION(DRV_VERSION);
/*#endif*/
/*
//---------------------------------------------------------------------------
//module_init(init_nasmesh);
//module_exit(exit_nasmesh);
//---------------------------------------------------------------------------
*/
This diff is collapsed.
......@@ -64,18 +64,6 @@
#include "constant.h"
#include "sap.h"
//#include "rrc_nas_primitives.h"
struct rb_entity {
OaiNwDrvRadioBearerId_t rab_id;
OaiNwDrvSapId_t sapi;
OaiNwDrvQoSTrafficClass_t qos;
u8 state;
u8 retry;
u32 countimer;
struct rb_entity *next;
};
struct cx_entity {
int sap[OAI_NW_DRV_SAPI_CX_MAX];
......@@ -84,14 +72,9 @@ struct cx_entity {
OaiNwDrvCellID_t cellid; // cell identification
u32 countimer; // timeout's counter
u8 retry; // number of retransmission
struct classifier_entity *sclassifier[OAI_NW_DRV_DSCP_MAX]; // send classifier;
struct classifier_entity *fclassifier[OAI_NW_DRV_DSCP_MAX]; // forward classifier;
u16 nsclassifier;
u16 nfclassifier;
u32 iid6[2]; // IPv6 interface identification
u8 iid4; // IPv4 interface identification
struct rb_entity *rb;
u16 num_rb; // number of radio bearer in linked list
int lastRRCprimitive;
//measures
int req_prov_id [OAI_NW_DRV_MAX_MEASURE_NB];
......@@ -101,34 +84,6 @@ struct cx_entity {
int provider_id [OAI_NW_DRV_MAX_MEASURE_NB];
};
struct classifier_entity {
u32 classref; // classifier identity
struct classifier_entity *next; // linked list
u8 ip_version; // IP version 4 or 6
union{
struct in6_addr ipv6;
u32 ipv4;
} saddr; // IP source address
u8 splen; // IP source prefix length
union{
struct in6_addr ipv6;
u32 ipv4;
unsigned int mpls_label;
} daddr; // IP destination address
u8 dplen; // IP destination prefix length
u8 protocol; // high layer protocol type (TCP, UDP,..)
unsigned char protocol_message_type;
u16 sport; // source port
u16 dport; // destination port
struct rb_entity *rb; // pointer to rb_entity for sending function or receiving in case of forwarding rule
struct rb_entity *rb_rx; // pointer to rb_entity for receiving (in case of forwarding rule)
OaiNwDrvRadioBearerId_t rab_id; // RAB identification for sending
OaiNwDrvRadioBearerId_t rab_id_rx; // RAB identification for receiving (in case of forwarding rule)
void (*fct)(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst);
};
//#define NAS_RETRY_LIMIT_DEFAULT 5
struct oai_nw_drv_priv {
int irq;
int rx_flags;
......@@ -139,7 +94,7 @@ struct oai_nw_drv_priv {
u32 timer_establishment;
u32 timer_release;
struct cx_entity cx[OAI_NW_DRV_CX_MAX];
struct classifier_entity *rclassifier[OAI_NW_DRV_DSCP_MAX]; // receive classifier
//struct classifier_entity *rclassifier[OAI_NW_DRV_DSCP_MAX]; // receive classifier
u16 nrclassifier;
int sap[OAI_NW_DRV_SAPI_MAX];
struct sock *nl_sk;
......@@ -173,15 +128,9 @@ typedef struct pdcp_data_ind_header_t {
extern struct net_device *oai_nw_drv_dev[OAI_NW_DRV_NB_INSTANCES_MAX];
//extern int bytes_wrote;
//extern int bytes_read;
extern u8 OAI_NW_DRV_NULL_IMEI[14];
//global variables shared with RRC
#ifndef OAI_NW_DRIVER_USE_NETLINK
extern int pdcp_2_oai_nw_drv_irq;
#endif
//extern u8 nas_IMEI[14];
#endif
\ No newline at end of file
......@@ -74,39 +74,33 @@ int oai_nw_drv_find_inst(struct net_device *dev);
// common.c
/**
\fn void oai_nw_drv_common_class_wireless2ip(unsigned short dlen, void* pdcp_sdu,int inst,struct classifier_entity *rclass,OaiNwDrvRadioBearerId_t rb_id)
\fn void oai_nw_drv_common_class_wireless2ip(unsigned short dlen, void* pdcp_sdu,int inst,OaiNwDrvRadioBearerId_t rb_id)
\brief Receive classified LTE packet, build skbuff struct with it and deliver it to the OS network layer.
@param dlen Length of SDU in bytes
@param pdcp_sdu Pointer to received SDU
@param inst Instance number
@param rclass RX Classifier entity
@param rb_id Radio Bearer Id
*/
void oai_nw_drv_common_class_wireless2ip(unsigned short dlen,
void *pdcp_sdu,
int inst,
struct classifier_entity *rclass,
OaiNwDrvRadioBearerId_t rb_id);
/**
\fn void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst)
\fn void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst)
\brief Request the transfer of data (QoS SAP)
@param skb pointer to socket buffer
@param cx pointer to connection entity for SDU
@param gc pointer to classifier entity for SDU
@param inst device instance
*/
void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst);
void oai_nw_drv_common_ip2wireless(struct sk_buff *skb, int inst);
/**
\fn void oai_nw_drv_common_ip2wireless_drop(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst)
\fn void oai_nw_drv_common_ip2wireless_drop(struct sk_buff *skb, int inst)
\brief Drop the IP packet comming from the OS network layer.
@param skb pointer to socket buffer
@param cx pointer to connection entity for SDU
@param gc pointer to classifier entity for SDU
@param inst device instance
*/
void oai_nw_drv_common_ip2wireless_drop(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst);
void oai_nw_drv_common_ip2wireless_drop(struct sk_buff *skb, int inst);
#ifndef OAI_NW_DRIVER_USE_NETLINK
/**
......@@ -122,49 +116,6 @@ void oai_nw_drv_common_wireless2ip(void);
void oai_nw_drv_common_wireless2ip(struct nlmsghdr *nlh);
#endif //OAI_NW_DRIVER_USE_NETLINK
/**
\fn struct rb_entity *oai_nw_drv_common_add_rb(struct cx_entity *cx, OaiNwDrvRadioBearerId_t rabi, OaiNwDrvQoSTrafficClass_t qos)
\brief Add a radio-bearer descriptor
@param gpriv pointer to driver instance private datas
@param cx pointer to connection entity
@param rabi radio-bearer index
@param qos NAS QOS traffic class
*/
struct rb_entity *oai_nw_drv_common_add_rb(struct oai_nw_drv_priv *gpriv, struct cx_entity *cx, OaiNwDrvRadioBearerId_t rab_id, OaiNwDrvQoSTrafficClass_t qos);
/**
\fn struct rb_entity *oai_nw_drv_common_search_rb(struct cx_entity *cx, OaiNwDrvRadioBearerId_t rabi)
\brief Search for a radio-bearer entity for a particular connection and radio-bearer index
@param cx pointer to connection entity
@param rabi radio-bearer index
@returns A pointer to the radio-bearer entity
*/
struct rb_entity *oai_nw_drv_common_search_rb(struct cx_entity *cx, OaiNwDrvRadioBearerId_t rabi);
/**
\fn struct cx_entity *oai_nw_drv_common_search_cx(OaiNwDrvLocalConnectionRef_t lcr,struct oai_nw_drv_priv *gpriv)
\brief Search for a connection entity based on its index and pointer to oai_nw_drv_priv
@param lcr index of local connection
@param gpriv pointer to oai_nw_drv_priv for device
@returns A pointer to the connection entity
*/
struct cx_entity *oai_nw_drv_common_search_cx(OaiNwDrvLocalConnectionRef_t lcr,struct oai_nw_drv_priv *gpriv);
/**
\fn struct classifier_entity *oai_nw_drv_common_search_class_for_rb(OaiNwDrvRadioBearerId_t rab_id,struct oai_nw_drv_priv *priv)
\brief Search for an RX classifier entity based on a RB id and pointer to oai_nw_drv_priv
@param rab_id Index of RAB for search
@param priv pointer to oai_nw_drv_priv for device
@returns A pointer to the corresponding RX classifier entity
*/
struct classifier_entity *oai_nw_drv_common_search_class_for_rb(OaiNwDrvRadioBearerId_t rab_id,struct oai_nw_drv_priv *priv);
/**
\fn void oai_nw_drv_common_flush_rb(struct cx_entity *cx)
\brief Clear all RB's for a particular connection
@param cx pointer to connection entity
*/
void oai_nw_drv_common_flush_rb(struct cx_entity *cx);
#ifdef OAI_NW_DRIVER_USE_NETLINK
/**
......@@ -186,15 +137,9 @@ void oai_nw_drv_COMMON_QOS_receive(struct nlmsghdr *nlh);
#endif //OAI_NW_DRIVER_USE_NETLINK
// int oai_nw_drv_mesh_DC_receive(struct cx_entity *cx,struct oai_nw_drv_priv *gpriv);
// int oai_nw_drv_mesh_GC_receive(struct oai_nw_drv_priv *gpriv);
// int oai_nw_drv_mesh_DC_send_cx_establish_request(struct cx_entity *cx,struct oai_nw_drv_priv *gpriv);
// int oai_nw_drv_mesh_DC_send_cx_release_request(struct cx_entity *cx,struct oai_nw_drv_priv *gpriv);
// void oai_nw_drv_mesh_DC_send_sig_data_request(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,struct oai_nw_drv_priv *gpriv);
// iocontrol.c
void oai_nw_drv_CTL_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc, int inst);
//int oai_nw_drv_CTL_receive_authentication(struct ipv6hdr *iph, struct cx-entity *cx, unsigned char sapi);
void oai_nw_drv_CTL_send(struct sk_buff *skb, int inst);
int oai_nw_drv_CTL_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
// classifier.c
......@@ -205,70 +150,9 @@ int oai_nw_drv_CTL_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
void oai_nw_drv_class_send(struct sk_buff *skb, //!< Pointer to socket buffer
int inst //!< Instance ID
);
/**
\brief
*/
struct classifier_entity *oai_nw_drv_class_add_send_classifier(struct cx_entity *cx, unsigned char dscp, unsigned short classref);
/**
\brief Send a socket received from IP to classifier for a particular instance ID.
*/
struct classifier_entity *oai_nw_drv_class_add_fwd_classifier(struct cx_entity *cx,
unsigned char dscp,
unsigned short classref
);
/**
\brief Send a socket received from IP to classifier for a particular instance ID.
*/
struct classifier_entity *oai_nw_drv_class_add_recv_classifier(unsigned char dscp,
unsigned short classref,
struct oai_nw_drv_priv*
);
/**
\brief
*/
void oai_nw_drv_class_del_send_classifier(struct cx_entity *cx,
unsigned char dscp,
unsigned short classref
);
/**
\brief
*/
void oai_nw_drv_class_del_fwd_classifier(struct cx_entity *cx,
unsigned char dscp,
unsigned short classref
);
/**
\brief
*/
void oai_nw_drv_class_del_recv_classifier(unsigned char dscp,
unsigned short classref,
struct oai_nw_drv_priv*
);
/**
\brief
*/
void oai_nw_drv_class_flush_send_classifier(struct cx_entity *cx);
/**
\brief
*/
void oai_nw_drv_class_flush_fwd_classifier(struct cx_entity *cx);
/**
\brief
*/
void oai_nw_drv_class_flush_recv_classifier(struct oai_nw_drv_priv *gpriv);
// tool.c
unsigned char oai_nw_drv_TOOL_invfct(struct classifier_entity *gc);
void oai_nw_drv_TOOL_fct(struct classifier_entity *gc, unsigned char fct);
void oai_nw_drv_TOOL_imei2iid(unsigned char *imei, unsigned char *iid);
void oai_nw_drv_TOOL_eNB_imei2iid(unsigned char *imei, unsigned char *iid, unsigned char len);
unsigned char oai_nw_drv_TOOL_get_dscp6(struct ipv6hdr *iph);
......@@ -285,9 +169,6 @@ void print_TOOL_pk_all(struct sk_buff *skb);
void print_TOOL_pk_ipv6(struct ipv6hdr *iph);
void print_TOOL_state(unsigned char state);
void oai_nw_drv_tool_print_buffer(char * buffer,int length);
void oai_nw_drv_print_rb_entity(struct rb_entity *rb);
void oai_nw_drv_print_classifier(struct classifier_entity *gc);
#ifdef OAI_NW_DRIVER_USE_NETLINK
// netlink.c
......
......@@ -42,58 +42,7 @@
//#define OAI_NW_DRV_DEBUG_TOOL 1
//---------------------------------------------------------------------------
//
void oai_nw_drv_TOOL_fct(struct classifier_entity *classifier, u8 fct){
//---------------------------------------------------------------------------
// Start debug information
#ifdef OAI_NW_DRV_DEBUG_TOOL
printk("OAI_NW_DRV_TOOL_FCT - begin \n");
#endif
if (classifier==NULL){
#ifdef OAI_NW_DRV_DEBUG_TOOL
printk("OAI_NW_DRV_TOOL_FCT - input parameter classifier is NULL \n");
#endif
return;
}
// End debug information
switch(fct){
case OAI_NW_DRV_FCT_QOS_SEND:
classifier->fct=oai_nw_drv_common_ip2wireless;
break;
case OAI_NW_DRV_FCT_CTL_SEND:
classifier->fct=oai_nw_drv_CTL_send;
break;
case OAI_NW_DRV_FCT_DEL_SEND:
classifier->fct=oai_nw_drv_common_ip2wireless_drop;
break;
default:
classifier->fct=oai_nw_drv_common_ip2wireless_drop;
}
}
//---------------------------------------------------------------------------
u8 oai_nw_drv_TOOL_invfct(struct classifier_entity *classifier){
//---------------------------------------------------------------------------
// Start debug information
#ifdef OAI_NW_DRV_DEBUG_TOOL
printk("OAI_NW_DRV_TOOL_INVFCT - begin \n");
#endif
if (classifier==NULL){
#ifdef OAI_NW_DRV_DEBUG_TOOL
printk("OAI_NW_DRV_TOOL_INVFCT - input parameter classifier is NULL \n");
#endif
return 0;
}
// End debug information
if (classifier->fct==oai_nw_drv_common_ip2wireless)
return OAI_NW_DRV_FCT_QOS_SEND;
if (classifier->fct==oai_nw_drv_CTL_send)
return OAI_NW_DRV_FCT_CTL_SEND;
if (classifier->fct==oai_nw_drv_common_ip2wireless_drop)
return OAI_NW_DRV_FCT_DEL_SEND;
return 0;
}
//---------------------------------------------------------------------------
u8 oai_nw_drv_TOOL_get_dscp6(struct ipv6hdr *iph){
......@@ -677,31 +626,7 @@ void print_TOOL_pk_all(struct sk_buff *skb){
return (1);
}*/
//---------------------------------------------------------------------------
void print_TOOL_state(u8 state){
//---------------------------------------------------------------------------
// case OAI_NW_DRV_STATE_IDLE:printk(" State OAI_NW_DRV_STATE_IDLE\n");return;
// case OAI_NW_DRV_STATE_CONNECTED:printk(" State OAI_NW_DRV_STATE_CONNECTED\n");return;
// case OAI_NW_DRV_STATE_ESTABLISHMENT_REQUEST:printk(" State OAI_NW_DRV_STATE_ESTABLISHMENT_REQUEST\n");return;
// case OAI_NW_DRV_STATE_ESTABLISHMENT_FAILURE:printk(" State OAI_NW_DRV_STATE_ESTABLISHMENT_FAILURE\n");return;
// case OAI_NW_DRV_STATE_RELEASE_FAILURE:printk(" State OAI_NW_DRV_STATE_RELEASE_FAILURE\n");return;
switch(state){
case OAI_NW_DRV_IDLE:printk("OAI_NW_DRV_IDLE\n");return;
case OAI_NW_DRV_CX_FACH:printk("OAI_NW_DRV_CX_FACH\n");return;
case OAI_NW_DRV_CX_DCH:printk("OAI_NW_DRV_CX_DCH\n");return;
case OAI_NW_DRV_CX_RECEIVED:printk("OAI_NW_DRV_CX_RECEIVED\n");return;
case OAI_NW_DRV_CX_CONNECTING:printk("OAI_NW_DRV_CX_CONNECTING\n");return;
case OAI_NW_DRV_CX_RELEASING:printk("OAI_NW_DRV_CX_RELEASING\n");return;
case OAI_NW_DRV_CX_CONNECTING_FAILURE:printk("OAI_NW_DRV_CX_CONNECTING_FAILURE\n");return;
case OAI_NW_DRV_CX_RELEASING_FAILURE:printk("OAI_NW_DRV_CX_RELEASING_FAILURE\n");return;
case OAI_NW_DRV_RB_ESTABLISHING:printk("OAI_NW_DRV_RB_ESTABLISHING\n");return;
case OAI_NW_DRV_RB_RELEASING:printk("OAI_NW_DRV_RB_RELEASING\n");return;
case OAI_NW_DRV_RB_DCH:printk("OAI_NW_DRV_RB_DCH\n");return;
default: printk(" Unknown state\n");
}
}
//-----------------------------------------------------------------------------
// Print the content of a buffer in hexadecimal
......@@ -725,42 +650,4 @@ void oai_nw_drv_tool_print_buffer(char * buffer,int length) {
printk("-%hx-",buffer[i]);
printk(",\t length %d\n", length);
}
//-----------------------------------------------------------------------------
void oai_nw_drv_print_rb_entity(struct rb_entity *rb){
//-----------------------------------------------------------------------------
// Start debug information
#ifdef OAI_NW_DRV_DEBUG_TOOL
printk("OAI_NW_DRV_PRINT_RB_ENTITY - begin \n");
#endif
if (rb==NULL){
#ifdef OAI_NW_DRV_DEBUG_TOOL
printk("OAI_NW_DRV_PRINT_RB_ENTITY - input parameter rb is NULL \n");
#endif
return;
}
// End debug information
printk("\nrb_entity content: rab_id %d, sapi %d, qos %d, \n", rb->rab_id, rb->sapi, rb->qos);
printk("state %d, retry %d, countimer %d\n",rb->state, rb->retry, rb->countimer);
};
//-----------------------------------------------------------------------------
void oai_nw_drv_print_classifier(struct classifier_entity *classifier){
//-----------------------------------------------------------------------------
// Start debug information
#ifdef OAI_NW_DRV_DEBUG_TOOL
printk("OAI_NW_DRV_PRINT_GC_ENTITY - begin \n");
#endif
if (classifier==NULL){
#ifdef OAI_NW_DRV_DEBUG_TOOL
printk("OAI_NW_DRV_PRINT_GC_ENTITY - input parameter classifier is NULL \n");
#endif
return;
}
// End debug information
printk("\nClassifier content: classref %d, version %d, splen %d, dplen %d,\n", classifier->classref, classifier->ip_version, classifier->splen, classifier->dplen);
printk("protocol %d, sport %d, dport %d, rab_id %d\n", classifier->protocol, classifier->sport, classifier->dport, classifier->rab_id);
if (classifier->rb != NULL){
oai_nw_drv_print_rb_entity(classifier->rb);
}
};
......@@ -37,7 +37,7 @@ ifeq ($(KERNEL_MAIN_VERSION),3)
IS_KERNEL_SUBVERSION_GREATER_THAN_29 = "true"
IS_KERNEL_SUBVERSION_GREATER_THAN_30 = "true"
IS_KERNEL_SUBVERSION_GREATER_THAN_32 = "true"
IS_KERNEL_SUBVERSION_GREATER_THAN_301=$(shell if [ $(SUBVERSION) -ge 1 ] ; then echo true ; fi)
IS_KERNEL_SUBVERSION_GREATER_THAN_301=$(shell if [ $(SUBVERSION) -ge 1 ] ; then echo true ; fi)
endif
GT2622 = $(if $(IS_KERNEL_SUBVERSION_GREATER_THAN_22),-DKERNEL_VERSION_GREATER_THAN_2622=1)
......
......@@ -45,6 +45,7 @@
#include "local.h"
#include "proto_extern.h"
#include "platform_constants.h"
//#define NETLINK_DEBUG 1
......
This diff is collapsed.
......@@ -96,7 +96,7 @@ int logInit (void) {
}
g_log->log_component[PHY].name = "PHY";
g_log->log_component[PHY].level = LOG_INFO;
g_log->log_component[PHY].level = LOG_EMERG;
g_log->log_component[PHY].flag = LOG_MED;
g_log->log_component[PHY].interval = 1;
g_log->log_component[PHY].fd = 0;
......@@ -104,7 +104,7 @@ int logInit (void) {
g_log->log_component[PHY].filelog_name = "/tmp/phy.log";
g_log->log_component[MAC].name = "MAC";
g_log->log_component[MAC].level = LOG_DEBUG;
g_log->log_component[MAC].level = LOG_EMERG;
g_log->log_component[MAC].flag = LOG_MED;
g_log->log_component[MAC].interval = 1;
g_log->log_component[MAC].fd = 0;
......@@ -112,7 +112,7 @@ int logInit (void) {
g_log->log_component[MAC].filelog_name = "/tmp/mac.log";
g_log->log_component[OPT].name = "OPT";
g_log->log_component[OPT].level = LOG_INFO;
g_log->log_component[OPT].level = LOG_EMERG;
g_log->log_component[OPT].flag = LOG_MED;
g_log->log_component[OPT].interval = 1;
g_log->log_component[OPT].fd = 0;
......@@ -144,7 +144,7 @@ int logInit (void) {
g_log->log_component[RRC].filelog_name = "/tmp/rrc.log";
g_log->log_component[EMU].name = "EMU";
g_log->log_component[EMU].level = LOG_INFO;
g_log->log_component[EMU].level = LOG_EMERG;
g_log->log_component[EMU].flag = LOG_MED;
g_log->log_component[EMU].interval = 1;
g_log->log_component[EMU].fd = 0;
......@@ -152,7 +152,7 @@ int logInit (void) {
g_log->log_component[EMU].filelog_name = "";
g_log->log_component[OMG].name = "OMG";
g_log->log_component[OMG].level = LOG_INFO;
g_log->log_component[OMG].level = LOG_EMERG;
g_log->log_component[OMG].flag = LOG_MED;
g_log->log_component[OMG].interval = 1;
g_log->log_component[OMG].fd = 0;
......@@ -160,7 +160,7 @@ int logInit (void) {
g_log->log_component[OMG].filelog_name = "";
g_log->log_component[OTG].name = "OTG";
g_log->log_component[OTG].level = LOG_FILE;
g_log->log_component[OTG].level = LOG_EMERG;
g_log->log_component[OTG].flag = LOG_MED;
g_log->log_component[OTG].interval = 1;
g_log->log_component[OTG].fd = 0;
......@@ -168,7 +168,7 @@ int logInit (void) {
g_log->log_component[OTG].filelog_name = "/tmp/otg.log";
g_log->log_component[OTG_LATENCY].name = "OTG_LATENCY";
g_log->log_component[OTG_LATENCY].level = LOG_FILE;
g_log->log_component[OTG_LATENCY].level = LOG_EMERG;
g_log->log_component[OTG_LATENCY].flag = LOG_MED;
g_log->log_component[OTG_LATENCY].interval = 1;
g_log->log_component[OTG_LATENCY].fd = 0;
......@@ -176,7 +176,7 @@ int logInit (void) {
g_log->log_component[OTG_LATENCY].filelog_name = "/tmp/otg_latency.dat";
g_log->log_component[OTG_LATENCY_BG].name = "OTG_LATENCY_BG";
g_log->log_component[OTG_LATENCY_BG].level = LOG_FILE;
g_log->log_component[OTG_LATENCY_BG].level = LOG_EMERG;
g_log->log_component[OTG_LATENCY_BG].flag = LOG_MED;
g_log->log_component[OTG_LATENCY_BG].interval = 1;
g_log->log_component[OTG_LATENCY_BG].fd = 0;
......@@ -185,7 +185,7 @@ int logInit (void) {
g_log->log_component[OTG_GP].name = "OTG_GP";
g_log->log_component[OTG_GP].level = LOG_FILE;
g_log->log_component[OTG_GP].level = LOG_EMERG;
g_log->log_component[OTG_GP].flag = LOG_MED;
g_log->log_component[OTG_GP].interval = 1;
g_log->log_component[OTG_GP].fd = 0;
......@@ -193,7 +193,7 @@ int logInit (void) {
g_log->log_component[OTG_GP].filelog_name = "/tmp/otg_GP.dat";
g_log->log_component[OTG_GP_BG].name = "OTG_GP_BG";
g_log->log_component[OTG_GP_BG].level = LOG_FILE;
g_log->log_component[OTG_GP_BG].level = LOG_EMERG;
g_log->log_component[OTG_GP_BG].flag = LOG_MED;
g_log->log_component[OTG_GP_BG].interval = 1;
g_log->log_component[OTG_GP_BG].fd = 0;
......@@ -201,7 +201,7 @@ int logInit (void) {
g_log->log_component[OTG_GP_BG].filelog_name = "/tmp/otg_GP_bg.dat";
g_log->log_component[OTG_JITTER].name = "OTG_JITTER";
g_log->log_component[OTG_JITTER].level = LOG_FILE;
g_log->log_component[OTG_JITTER].level = LOG_EMERG;
g_log->log_component[OTG_JITTER].flag = LOG_MED;
g_log->log_component[OTG_JITTER].interval = 1;
g_log->log_component[OTG_JITTER].fd = 0;
......@@ -209,7 +209,7 @@ int logInit (void) {
g_log->log_component[OTG_JITTER].filelog_name = "/tmp/otg_jitter.dat";
g_log->log_component[OCG].name = "OCG";
g_log->log_component[OCG].level = LOG_INFO;
g_log->log_component[OCG].level = LOG_EMERG;
g_log->log_component[OCG].flag = LOG_MED;
g_log->log_component[OCG].interval = 1;
g_log->log_component[OCG].fd = 0;
......@@ -217,7 +217,7 @@ int logInit (void) {
g_log->log_component[OCG].filelog_name = "";
g_log->log_component[PERF].name = "PERF";
g_log->log_component[PERF].level = LOG_INFO;
g_log->log_component[PERF].level = LOG_EMERG;
g_log->log_component[PERF].flag = LOG_MED;
g_log->log_component[PERF].interval = 1;
g_log->log_component[PERF].fd = 0;
......@@ -225,7 +225,7 @@ int logInit (void) {
g_log->log_component[PERF].filelog_name = "";
g_log->log_component[OIP].name = "OIP";
g_log->log_component[OIP].level = LOG_INFO;
g_log->log_component[OIP].level = LOG_EMERG;
g_log->log_component[OIP].flag = LOG_MED;
g_log->log_component[OIP].interval = 1;
g_log->log_component[OIP].fd = 0;
......@@ -233,7 +233,7 @@ int logInit (void) {
g_log->log_component[OIP].filelog_name = "";
g_log->log_component[CLI].name = "CLI";
g_log->log_component[CLI].level = LOG_INFO;
g_log->log_component[CLI].level = LOG_EMERG;
g_log->log_component[CLI].flag = LOG_MED;
g_log->log_component[CLI].interval = 1;
g_log->log_component[CLI].fd = 0;
......@@ -241,7 +241,7 @@ int logInit (void) {
g_log->log_component[CLI].filelog_name = "";
g_log->log_component[MSC].name = "MSC";
g_log->log_component[MSC].level = LOG_TRACE;
g_log->log_component[MSC].level = LOG_EMERG;
g_log->log_component[MSC].flag = LOG_MED;
g_log->log_component[MSC].interval = 1;
g_log->log_component[MSC].fd = 0;
......@@ -249,7 +249,7 @@ int logInit (void) {
g_log->log_component[MSC].filelog_name = "/tmp/msc.log";
g_log->log_component[OCM].name = "OCM";
g_log->log_component[OCM].level = LOG_TRACE;
g_log->log_component[OCM].level = LOG_EMERG;
g_log->log_component[OCM].flag = LOG_MED;
g_log->log_component[OCM].interval = 1;
g_log->log_component[OCM].fd = 0;
......@@ -257,7 +257,7 @@ int logInit (void) {
g_log->log_component[OCM].filelog_name = "/tmp/ocm.log";
g_log->log_component[S1AP].name = "S1AP";
g_log->log_component[S1AP].level = LOG_TRACE;
g_log->log_component[S1AP].level = LOG_EMERG;
g_log->log_component[S1AP].flag = LOG_MED;
g_log->log_component[S1AP].interval = 1;
g_log->log_component[S1AP].fd = 0;
......@@ -265,7 +265,7 @@ int logInit (void) {
g_log->log_component[S1AP].filelog_name = "/tmp/s1ap.log";
g_log->log_component[SCTP].name = "SCTP";
g_log->log_component[SCTP].level = LOG_TRACE;
g_log->log_component[SCTP].level = LOG_EMERG;
g_log->log_component[SCTP].flag = LOG_MED;
g_log->log_component[SCTP].interval = 1;
g_log->log_component[SCTP].fd = 0;
......@@ -273,7 +273,7 @@ int logInit (void) {
g_log->log_component[SCTP].filelog_name = "";
g_log->log_component[HW].name = "HW";
g_log->log_component[HW].level = LOG_DEBUG;
g_log->log_component[HW].level = LOG_EMERG;
g_log->log_component[HW].flag = LOG_MED;
g_log->log_component[HW].interval = 1;
g_log->log_component[HW].fd = 0;
......
all: oaisim naslite_netlink_ether
userclean: clean oaisim naslite_netlink_ether
userclean: clean oaisim naslite_netlink_ether
oaisim:
(cd $(OPENAIR_TARGETS)/SIMU/USER && make NAS=1 OAI_NW_DRIVER_TYPE_ETHERNET=1 -j2)
oaisim:
(cd $(OPENAIR_TARGETS)/SIMU/USER && make NAS=1 OAI_NW_DRIVER_TYPE_ETHERNET=1 Rel10=1 -j8)
naslite_netlink_ether:
(cd $(OPENAIR2_DIR) && make naslite_netlink_ether.ko)
(cd $(OPENAIR2_DIR)/NAS/DRIVER/LITE/RB_TOOL/ && make)
clean:
(cd $(OPENAIR_TARGETS)/SIMU/USER && make clean)
clean:
(cd $(OPENAIR2_DIR)/NAS/DRIVER/LITE && make clean)
(cd $(OPENAIR_TARGETS)/SIMU/USER && make clean)
(cd $(OPENAIR_TARGETS)/SIMU/USER && make cleanasn1)
......@@ -416,7 +416,15 @@ int olg_config() {
oai_emulation.info.g_log_verbosity,
oai_emulation.emulation_config.log_emu.interval);
// if perf eval then reset the otg log level
/*
set_comp_log(PHY, LOG_NONE, 0x15,1);
set_comp_log(EMU, LOG_NONE, 0x15,1);
set_comp_log(OCG, LOG_NONE, 0x15,1);
set_comp_log(OCM, LOG_NONE, 0x15,1);
set_comp_log(OTG, LOG_NONE, 0x15,1);
set_comp_log(MAC, LOG_NONE, 0x15,1);
set_comp_log(OMG, LOG_NONE, 0x15,1);
set_comp_log(OPT, LOG_ERR, 0x15,1);
/*
set_log(OCG, LOG_DEBUG, 1);
set_log(EMU, LOG_INFO, 20);
set_log(MAC, LOG_DEBUG, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment