Commit f6e664af authored by gauthier's avatar 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)