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);
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_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));
ret = bind(nas_sock_fd, (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
printf("[NETLINK] bind returns %d\n",ret);
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 */
nas_nlh=(struct nlmsghdr *)malloc(NLMSG_SPACE(MAX_PAYLOAD));
// 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->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));
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,6 +12,8 @@
#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
# define NB_MODULES_MAX 128
......@@ -45,6 +47,7 @@
# define MAX_MANAGED_RG_PER_MOBILE 2
# define DEFAULT_RAB_ID 3
# define NB_RB_MAX 11
# define NB_RAB_MAX 8 // 4
# define RAB_SHIFT1 9
......
......@@ -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"
......
This diff is collapsed.
......@@ -40,6 +40,7 @@ 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.time_out > 0) {
if (rlcP->t_status_prohibit.running) {
if (
// CASE 1: start time out
......@@ -73,7 +74,9 @@ void rlc_am_check_timer_status_prohibit(rlc_am_entity_t *rlcP,u32_t frame)
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)
//-----------------------------------------------------------------------------
{
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;
}
}
//-----------------------------------------------------------------------------
void rlc_am_start_timer_status_prohibit(rlc_am_entity_t *rlcP,u32_t frame)
//-----------------------------------------------------------------------------
{
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];
......
......@@ -10,55 +10,57 @@ 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
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"
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
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)
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
####################################################
KERNEL_ARCH=$(shell echo `uname -m`)
SET_X64=$(shell if [ $(KERNEL_ARCH) = 'x86_64' ]; then echo true ; fi)
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)
####################################################
# 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
......@@ -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;
......@@ -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: