Merge remote-tracking branch 'origin/develop' into enhancement-ltem
Conflicts: openair1/PHY/INIT/lte_init.c openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c openair1/PHY/LTE_TRANSPORT/dci.c openair1/PHY/LTE_TRANSPORT/dci_tools.c openair1/PHY/LTE_TRANSPORT/dlsch_coding.c openair1/PHY/LTE_TRANSPORT/edci.c openair1/PHY/LTE_TRANSPORT/if4_tools.c openair1/PHY/LTE_TRANSPORT/prach.c openair1/PHY/LTE_TRANSPORT/print_stats.c openair1/PHY/LTE_TRANSPORT/pucch.c openair1/PHY/LTE_TRANSPORT/transport_eNB.h openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h openair1/PHY/impl_defs_lte.h openair1/SCHED/fapi_l1.c openair1/SCHED/phy_procedures_lte_eNb.c openair2/COMMON/rrc_messages_types.h openair2/ENB_APP/enb_config.c openair2/ENB_APP/enb_paramdef.h openair2/LAYER2/MAC/config.c openair2/LAYER2/MAC/defs.h openair2/LAYER2/MAC/eNB_scheduler.c openair2/LAYER2/MAC/eNB_scheduler_RA.c openair2/LAYER2/MAC/eNB_scheduler_bch.c openair2/LAYER2/MAC/eNB_scheduler_dlsch.c openair2/LAYER2/MAC/eNB_scheduler_primitives.c openair2/LAYER2/MAC/eNB_scheduler_ulsch.c openair2/LAYER2/MAC/pre_processor.c openair2/LAYER2/MAC/rar_tools.c openair2/LAYER2/MAC/ue_procedures.c openair2/PHY_INTERFACE/IF_Module.c openair2/RRC/LITE/rrc_common.c openair2/RRC/LTE/L2_interface_ue.c openair2/RRC/LTE/MESSAGES/asn1_msg.c openair2/RRC/LTE/rrc_eNB.c targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp targets/RT/USER/lte-enb.c targets/RT/USER/lte-ru.c
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
# NASMESH Driver makefile
|
||||
#
|
||||
include $(OPENAIR_DIR)/common/utils/Makefile.inc
|
||||
NAS_UPDIR := $(shell /bin/pwd)
|
||||
|
||||
KERNEL_ARCH:=$(shell echo `uname -m`)
|
||||
SET_X64:=$(shell if [ $(KERNEL_ARCH) = 'x86_64' ]; then echo true ; fi)
|
||||
|
||||
####################################################
|
||||
# EXTRA COMPILER FLAGS
|
||||
####################################################
|
||||
EXTRA_CFLAGS = -I$(OPENAIR2_DIR)/COMMON -fno-common -fno-stack-protector -mpreferred-stack-boundary=4 $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,)
|
||||
|
||||
ifdef ADDRCONF
|
||||
EXTRA_CFLAGS += -DADDRCONF
|
||||
endif
|
||||
|
||||
ifdef OAI_NW_DRIVER_TYPE_ETHERNET
|
||||
EXTRA_CFLAGS += -DOAI_NW_DRIVER_TYPE_ETHERNET
|
||||
endif
|
||||
|
||||
ifdef OAI_NW_DRIVER_USE_NETLINK
|
||||
EXTRA_CFLAGS += -DOAI_NW_DRIVER_USE_NETLINK
|
||||
else
|
||||
EXTRA_CFLAGS += $(shell rtai-config --module-cflags) -DRTAI -D__IN_RTAI__ -Wall
|
||||
endif
|
||||
|
||||
ccflags-y= $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CFLAGS=
|
||||
|
||||
ifdef LOOPBACK
|
||||
EXTRA_CFLAGS += -DLOOPBACK_TEST
|
||||
endif
|
||||
|
||||
ifdef ADDRESS_FIX
|
||||
EXTRA_CFLAGS += -DNAS_ADDRESS_FIX
|
||||
endif
|
||||
|
||||
####################################################
|
||||
# LOADABLE MODULE GOALS
|
||||
####################################################
|
||||
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 += tool.o
|
||||
ifdef OAI_NW_DRIVER_USE_NETLINK
|
||||
oai_nw_drv-objs += netlink.o
|
||||
endif
|
||||
|
||||
####################################################
|
||||
# REVOIR LE CLEAN
|
||||
####################################################
|
||||
|
||||
#netlink.ko:
|
||||
#make $(x)$(y) PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR) M=`pwd` modules
|
||||
|
||||
#oai_nw_drv.ko:
|
||||
# make V=1 -C $(KERNEL_DIR) M=`pwd` modules
|
||||
print:
|
||||
@echo subversion : $(SUBVERSION)
|
||||
clean:
|
||||
rm -f *.ko
|
||||
rm -f .*.ko.cmd
|
||||
rm -f .*.o.cmd
|
||||
rm -f *.o
|
||||
rm -f *.mod.c
|
||||
find . -name *.ko -delete
|
||||
find . -name .*.o -delete
|
||||
find . -name *.o -delete
|
||||
find . -name *.mod.c -delete
|
||||
@@ -333,7 +333,7 @@ void oai_nw_drv_common_class_wireless2ip(uint16_t dlen,
|
||||
|
||||
printk("\n");
|
||||
#endif //OAI_DRV_DEBUG_RECEIVE
|
||||
netif_rx(skb);
|
||||
netif_rx_ni(skb);
|
||||
#ifdef OAI_DRV_DEBUG_RECEIVE
|
||||
printk("[OAI_IP_DRV][%s] end\n",__FUNCTION__);
|
||||
#endif
|
||||
|
||||
@@ -28,13 +28,6 @@
|
||||
*/
|
||||
/*******************************************************************************/
|
||||
|
||||
#ifndef OAI_NW_DRIVER_USE_NETLINK
|
||||
#ifdef RTAI
|
||||
#include "rtai_posix.h"
|
||||
#define RTAI_IRQ 30 //try to get this irq with RTAI
|
||||
#endif // RTAI
|
||||
#endif // OAI_NW_DRIVER_USE_NETLINK
|
||||
|
||||
#include "constant.h"
|
||||
#include "local.h"
|
||||
#include "proto_extern.h"
|
||||
@@ -519,23 +512,12 @@ int init_module (void)
|
||||
|
||||
#ifndef OAI_NW_DRIVER_USE_NETLINK
|
||||
|
||||
#ifdef RTAI //with RTAI you have to indicate which irq# you want
|
||||
|
||||
pdcp_2_oai_nw_drv_irq=rt_request_srq(0, oai_nw_drv_interrupt, NULL);
|
||||
|
||||
#endif
|
||||
|
||||
if (pdcp_2_oai_nw_drv_irq == -EBUSY || pdcp_2_oai_nw_drv_irq == -EINVAL) {
|
||||
printk("[OAI_IP_DRV][%s] No interrupt resource available\n", __FUNCTION__);
|
||||
return -EBUSY;
|
||||
} else
|
||||
printk("[OAI_IP_DRV][%s] Interrupt %d\n", __FUNCTION__, pdcp_2_oai_nw_drv_irq);
|
||||
|
||||
//rt_startup_irq(RTAI_IRQ);
|
||||
|
||||
//rt_enable_irq(RTAI_IRQ);
|
||||
|
||||
|
||||
#endif //NETLINK
|
||||
|
||||
for (inst=0; inst<OAI_NW_DRV_NB_INSTANCES_MAX; inst++) {
|
||||
@@ -601,12 +583,6 @@ void cleanup_module(void)
|
||||
|
||||
if (pdcp_2_oai_nw_drv_irq!=-EBUSY) {
|
||||
pdcp_2_oai_nw_drv_irq=0;
|
||||
#ifdef RTAI
|
||||
// V1
|
||||
// rt_free_linux_irq(priv->irq, NULL);
|
||||
// END V1
|
||||
rt_free_srq(pdcp_2_oai_nw_drv_irq);
|
||||
#endif
|
||||
// Start IRQ linux
|
||||
//free_irq(priv->irq, NULL);
|
||||
// End IRQ linux
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
# NASMESH Driver makefile
|
||||
#
|
||||
include $(OPENAIR_DIR)/common/utils/Makefile.inc
|
||||
NAS_UPDIR := $(shell /bin/pwd)
|
||||
|
||||
####################################################
|
||||
# NASMESH compilation flags
|
||||
####################################################
|
||||
#RTAI=1
|
||||
|
||||
####################################################
|
||||
# D E B U G F L A G S
|
||||
####################################################
|
||||
|
||||
####################################################
|
||||
# EXTRA COMPILER FLAGS
|
||||
####################################################
|
||||
#EXTRA_CFLAGS = -fno-common -fno-stack-protector -mpreferred-stack-boundary=4 $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,)
|
||||
EXTRA_CFLAGS += -I$(OPENAIR2_DIR)
|
||||
ifdef PDCP_USE_NETLINK
|
||||
EXTRA_CFLAGS += -DPDCP_USE_NETLINK
|
||||
else
|
||||
EXTRA_CFLAGS += $(shell rtai-config --module-cflags) -DRTAI -D__IN_RTAI__ -Wall
|
||||
endif
|
||||
|
||||
ifdef LOOPBACK
|
||||
EXTRA_CFLAGS += -DLOOPBACK_TEST
|
||||
endif
|
||||
|
||||
ifdef ADDRESS_FIX
|
||||
EXTRA_CFLAGS += -DNAS_ADDRESS_FIX
|
||||
endif
|
||||
ifdef NAS_DEBUG_RECEIVE
|
||||
EXTRA_CFLAGS += -DNAS_DEBUG_RECEIVE
|
||||
endif
|
||||
|
||||
ifdef NAS_DEBUG_SEND
|
||||
EXTRA_CFLAGS += -DNAS_DEBUG_SEND
|
||||
endif
|
||||
|
||||
ccflags-y := $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CFLAGS=
|
||||
|
||||
####################################################
|
||||
# LOADABLE MODULE GOALS
|
||||
####################################################
|
||||
obj-m += nasmesh.o
|
||||
nasmesh-objs += device.o
|
||||
nasmesh-objs += common.o
|
||||
nasmesh-objs += ioctl.o
|
||||
nasmesh-objs += classifier.o
|
||||
nasmesh-objs += tool.o
|
||||
nasmesh-objs += mesh.o
|
||||
ifdef PDCP_USE_NETLINK
|
||||
nasmesh-objs += netlink.o
|
||||
endif
|
||||
|
||||
####################################################
|
||||
# REVOIR LE CLEAN
|
||||
####################################################
|
||||
|
||||
#netlink.ko:
|
||||
# make PDCP_USE_NETLINK=1 V=1 -C $(KERNEL_DIR) M=`pwd` modules
|
||||
|
||||
#nasmesh.ko:
|
||||
# make V=1 -C $(KERNEL_DIR) M=`pwd` modules
|
||||
|
||||
clean:
|
||||
rm -f $(nasmesh-objs) $(obj-m)
|
||||
# make -C $(KERNEL_DIR) modules
|
||||
@@ -410,7 +410,7 @@ struct cx_entity *nas_CLASS_cx6(struct sk_buff *skb,
|
||||
#endif //NAS_DEBUG_CLASS
|
||||
|
||||
//if ((dst = (unsigned int*)&(((struct rt6_info *)skbdst)->rt6i_gateway)) == 0){
|
||||
if ((dst = ((struct iphdr*)(skb_network_header(skb)))->daddr) == 0) {
|
||||
if ( (dst = &((struct iphdr*)(skb_network_header(skb)))->daddr) == NULL) {
|
||||
|
||||
printk("nas_CLASS_cx6: dst addr is null \n");
|
||||
p = p->next;
|
||||
@@ -475,7 +475,7 @@ struct cx_entity *nas_CLASS_cx4(struct sk_buff *skb,
|
||||
if (skb!=NULL) {
|
||||
daddr = ((struct iphdr*)(skb_network_header(skb)))->daddr;
|
||||
|
||||
if (daddr!=NULL) {
|
||||
if (daddr!=0) {
|
||||
|
||||
#ifdef NAS_DEBUG_CLASS
|
||||
printk("[NAS][CLASS][IPv4] Searching for %d.%d.%d.%d\n",
|
||||
|
||||
@@ -28,12 +28,8 @@
|
||||
* \email: navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
|
||||
*/
|
||||
|
||||
//#include "nas_common.h"
|
||||
#include "local.h"
|
||||
#include "proto_extern.h"
|
||||
#ifdef RTAI
|
||||
#include "rtai_fifos.h"
|
||||
#endif
|
||||
|
||||
//#define NAS_DEBUG_RECEIVE 1
|
||||
//#define NAS_DEBUG_SEND 1
|
||||
@@ -57,17 +53,14 @@ void nas_COMMON_receive(uint16_t dlen,
|
||||
struct sk_buff *skb;
|
||||
struct ipversion *ipv;
|
||||
struct nas_priv *gpriv=netdev_priv(nasdev[inst]);
|
||||
uint32_t odaddr,osaddr;
|
||||
|
||||
//int i;
|
||||
|
||||
unsigned char protocol;
|
||||
|
||||
unsigned char /**addr,*/ *daddr,*saddr,*ifaddr /*,sn*/;
|
||||
|
||||
//struct udphdr *uh;
|
||||
//struct tcphdr *th;
|
||||
uint16_t *cksum,check;
|
||||
|
||||
struct iphdr *network_header;
|
||||
|
||||
@@ -118,11 +111,12 @@ void nas_COMMON_receive(uint16_t dlen,
|
||||
// Make the third byte of both the source and destination equal to the fourth of the destination
|
||||
|
||||
|
||||
|
||||
unsigned char * ifaddr, *saddr, daddr;
|
||||
daddr = (unsigned char *)&((struct iphdr *)skb->data)->daddr;
|
||||
odaddr = ((struct iphdr *)skb->data)->daddr;
|
||||
// sn = addr[3];
|
||||
saddr = (unsigned char *)&((struct iphdr *)skb->data)->saddr;
|
||||
uint32_t odaddr,osaddr;
|
||||
osaddr = ((struct iphdr *)skb->data)->saddr;
|
||||
|
||||
if (daddr[0] == saddr[0]) {// same network
|
||||
@@ -223,6 +217,7 @@ void nas_COMMON_receive(uint16_t dlen,
|
||||
|
||||
case IPPROTO_TCP:
|
||||
|
||||
uint16_t *cksum,check;
|
||||
cksum = (uint16_t*)&(((struct tcphdr*)(((char *)network_header + (network_header->ihl<<2))))->check);
|
||||
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
|
||||
|
||||
@@ -313,7 +308,7 @@ void nas_COMMON_receive(uint16_t dlen,
|
||||
|
||||
printk("\n");
|
||||
#endif //NAS_DEBUG_RECEIVE
|
||||
netif_rx(skb);
|
||||
netif_rx_ni(skb);
|
||||
#ifdef NAS_DEBUG_RECEIVE
|
||||
printk("NAS_COMMON_RECEIVE: end\n");
|
||||
#endif
|
||||
|
||||
@@ -28,13 +28,6 @@
|
||||
*/
|
||||
/*******************************************************************************/
|
||||
|
||||
#ifndef PDCP_USE_NETLINK
|
||||
#ifdef RTAI
|
||||
#include "rtai_posix.h"
|
||||
#define RTAI_IRQ 30 //try to get this irq with RTAI
|
||||
#endif // RTAI
|
||||
#endif // PDCP_USE_NETLINK
|
||||
|
||||
#include "constant.h"
|
||||
#include "local.h"
|
||||
#include "proto_extern.h"
|
||||
@@ -116,6 +109,7 @@ void *nas_interrupt(void)
|
||||
printk("INTERRUPT: end\n");
|
||||
#endif
|
||||
// return 0;
|
||||
return NULL;
|
||||
}
|
||||
#endif //NETLINK
|
||||
|
||||
@@ -247,7 +241,7 @@ int nas_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
|
||||
// End debug information
|
||||
netif_stop_queue(dev);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1796)
|
||||
netif_trans_update(dev);
|
||||
#else
|
||||
dev->trans_start = jiffies;
|
||||
@@ -312,7 +306,7 @@ void nas_tx_timeout(struct net_device *dev)
|
||||
printk("TX_TIMEOUT: begin\n");
|
||||
// (struct nas_priv *)(dev->priv)->stats.tx_errors++;
|
||||
(priv->stats).tx_errors++;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1796)
|
||||
netif_trans_update(dev);
|
||||
#else
|
||||
dev->trans_start = jiffies;
|
||||
@@ -330,7 +324,11 @@ static const struct net_device_ops nasmesh_netdev_ops = {
|
||||
.ndo_set_mac_address = NULL,
|
||||
.ndo_set_config = nas_set_config,
|
||||
.ndo_do_ioctl = nas_CTL_ioctl,
|
||||
#if (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE>=1797)
|
||||
.extended.ndo_change_mtu = nas_change_mtu,
|
||||
#else
|
||||
.ndo_change_mtu = nas_change_mtu,
|
||||
#endif
|
||||
.ndo_tx_timeout = nas_tx_timeout,
|
||||
};
|
||||
|
||||
@@ -449,23 +447,12 @@ int init_module (void)
|
||||
|
||||
#ifndef PDCP_USE_NETLINK
|
||||
|
||||
#ifdef RTAI //with RTAI you have to indicate which irq# you want
|
||||
|
||||
pdcp_2_nas_irq=rt_request_srq(0, nas_interrupt, NULL);
|
||||
|
||||
#endif
|
||||
|
||||
if (pdcp_2_nas_irq == -EBUSY || pdcp_2_nas_irq == -EINVAL) {
|
||||
printk("[NAS][INIT] No interrupt resource available\n");
|
||||
return -EBUSY;
|
||||
} else
|
||||
printk("[NAS][INIT]: Interrupt %d\n", pdcp_2_nas_irq);
|
||||
|
||||
//rt_startup_irq(RTAI_IRQ);
|
||||
|
||||
//rt_enable_irq(RTAI_IRQ);
|
||||
|
||||
|
||||
#endif //NETLINK
|
||||
|
||||
for (inst=0; inst<NB_INSTANCES_MAX; inst++) {
|
||||
@@ -529,12 +516,6 @@ void cleanup_module(void)
|
||||
|
||||
if (pdcp_2_nas_irq!=-EBUSY) {
|
||||
pdcp_2_nas_irq=0;
|
||||
#ifdef RTAI
|
||||
// V1
|
||||
// rt_free_linux_irq(priv->irq, NULL);
|
||||
// END V1
|
||||
rt_free_srq(pdcp_2_nas_irq);
|
||||
#endif
|
||||
// Start IRQ linux
|
||||
// free_irq(priv->irq, NULL);
|
||||
// End IRQ linux
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include <linux/version.h>
|
||||
#include "local.h"
|
||||
#include "proto_extern.h"
|
||||
|
||||
@@ -155,10 +155,18 @@ void nas_mesh_start_default_sclassifier(struct cx_entity *cx,struct rb_entity *r
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
void nas_mesh_timer(struct timer_list *t)
|
||||
#else
|
||||
void nas_mesh_timer(unsigned long data)
|
||||
#endif
|
||||
{
|
||||
//---------------------------------------------------------------------------
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
struct nas_priv *gpriv=from_timer(gpriv, t, timer);
|
||||
#else
|
||||
struct nas_priv *gpriv=(struct nas_priv *) data;
|
||||
#endif
|
||||
uint8_t cxi;
|
||||
struct cx_entity *cx;
|
||||
struct rb_entity *rb;
|
||||
@@ -166,10 +174,14 @@ void nas_mesh_timer(unsigned long data)
|
||||
#ifdef NAS_DEBUG_TIMER
|
||||
printk("NAS_MESH_TIMER - begin \n");
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
timer_setup(&gpriv->timer, nas_mesh_timer, 0);
|
||||
mod_timer(&gpriv->timer, jiffies+NAS_TIMER_TICK);
|
||||
#else
|
||||
(gpriv->timer).function=nas_mesh_timer;
|
||||
(gpriv->timer).expires=jiffies+NAS_TIMER_TICK;
|
||||
(gpriv->timer).data=data;
|
||||
#endif
|
||||
|
||||
return;
|
||||
|
||||
|
||||
@@ -195,7 +195,6 @@ void nas_mesh_init(int inst //!< Instance ID
|
||||
|
||||
);
|
||||
|
||||
void nas_mesh_timer(unsigned long data);
|
||||
|
||||
int nas_mesh_DC_receive(struct cx_entity *cx,struct nas_priv *gpriv);
|
||||
int nas_mesh_GC_receive(struct nas_priv *gpriv);
|
||||
|
||||
@@ -679,11 +679,11 @@ void print_TOOL_pk_all(struct sk_buff *skb)
|
||||
|
||||
switch (ntohs(skb->protocol)) {
|
||||
case ETH_P_IPV6:
|
||||
print_TOOL_pk_ipv6((struct ipv6hdr *)skb->network_header);
|
||||
print_TOOL_pk_ipv6((struct ipv6hdr *)skb_network_header(skb));
|
||||
break;
|
||||
|
||||
case ETH_P_IP:
|
||||
print_TOOL_pk_ipv4((struct iphdr *)skb->network_header);
|
||||
print_TOOL_pk_ipv4((struct iphdr *)skb_network_header(skb));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
# UE IP Driver makefile
|
||||
#
|
||||
NAS_UPDIR := $(shell /bin/pwd)
|
||||
|
||||
KERNEL_ARCH=$(shell echo `uname -m`)
|
||||
SET_X64=$(shell if [ $(KERNEL_ARCH) = 'x86_64' ]; then echo true ; fi)
|
||||
|
||||
####################################################
|
||||
# EXTRA COMPILER FLAGS
|
||||
####################################################
|
||||
EXTRA_CFLAGS = -I$(OPENAIR2_DIR)/COMMON -fno-common -fno-stack-protector -mpreferred-stack-boundary=4 $(if $(SET_X64),-DARCH_64,) $(if $(SET_X64),-mcmodel=kernel,) $(if $(SET_X64),-m64,)
|
||||
|
||||
|
||||
|
||||
ifdef OAI_NW_DRIVER_USE_NETLINK
|
||||
EXTRA_CFLAGS += -DOAI_NW_DRIVER_USE_NETLINK
|
||||
else
|
||||
EXTRA_CFLAGS += $(shell rtai-config --module-cflags) -DRTAI -D__IN_RTAI__ -Wall
|
||||
endif
|
||||
|
||||
|
||||
####################################################
|
||||
# LOADABLE MODULE GOALS
|
||||
####################################################
|
||||
obj-m += ue_ip.o
|
||||
ue_ip-objs += device.o
|
||||
ue_ip-objs += common.o
|
||||
ifdef OAI_NW_DRIVER_USE_NETLINK
|
||||
ue_ip-objs += netlink.o
|
||||
endif
|
||||
|
||||
####################################################
|
||||
# REVOIR LE CLEAN
|
||||
####################################################
|
||||
|
||||
|
||||
print:
|
||||
@echo SET_X64 : $(SET_X64)
|
||||
|
||||
clean:
|
||||
rm -f *.ko
|
||||
rm -f .*.ko.cmd
|
||||
rm -f .*.o.cmd
|
||||
rm -f *.o
|
||||
rm -f *.mod.c
|
||||
find . -name *.ko -delete
|
||||
find . -name .*.o -delete
|
||||
find . -name *.o -delete
|
||||
find . -name *.mod.c -delete
|
||||
@@ -222,7 +222,7 @@ skb_p->mark = rb_idP;
|
||||
|
||||
printk("\n");
|
||||
#endif //OAI_DRV_DEBUG_RECEIVE
|
||||
netif_rx(skb_p);
|
||||
netif_rx_ni(skb_p);
|
||||
#ifdef OAI_DRV_DEBUG_RECEIVE
|
||||
printk("[UE_IP_DRV][%s] end\n",__FUNCTION__);
|
||||
#endif
|
||||
@@ -248,6 +248,13 @@ ue_ip_common_ip2wireless(
|
||||
//---------------------------------------------------------------------------
|
||||
struct pdcp_data_req_header_s pdcph;
|
||||
ue_ip_priv_t *priv_p=netdev_priv(ue_ip_dev[instP]);
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
ipversion_t *ipv_p = NULL;
|
||||
unsigned int hard_header_len = 0;
|
||||
unsigned char *src_addr = 0;
|
||||
unsigned char *dst_addr = 0;
|
||||
#endif
|
||||
|
||||
#ifdef LOOPBACK_TEST
|
||||
int i;
|
||||
#endif
|
||||
@@ -278,6 +285,37 @@ ue_ip_common_ip2wireless(
|
||||
|
||||
pdcph.inst = instP;
|
||||
|
||||
//pass source/destination IP addresses to PDCP header
|
||||
hard_header_len = ue_ip_dev[instP]->hard_header_len;
|
||||
ipv_p = (ipversion_t *)((void *)&(skb_pP->data[hard_header_len]));
|
||||
|
||||
switch (ipv_p->version) {
|
||||
case 6:
|
||||
printk("[UE_IP_DRV][%s] receive IPv6 message\n",__FUNCTION__);
|
||||
//TODO
|
||||
break;
|
||||
|
||||
case 4:
|
||||
src_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->saddr;
|
||||
if (src_addr) {
|
||||
printk("[UE_IP_DRV][%s] Source %d.%d.%d.%d\n",__FUNCTION__, src_addr[0],src_addr[1],src_addr[2],src_addr[3]);
|
||||
}
|
||||
dst_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->daddr;
|
||||
if (dst_addr) {
|
||||
printk("[UE_IP_DRV][%s] Dest %d.%d.%d.%d\n",__FUNCTION__, dst_addr[0],dst_addr[1],dst_addr[2],dst_addr[3]);
|
||||
}
|
||||
|
||||
//get Ipv4 address and pass to PCDP header
|
||||
printk("[UE_IP_DRV] source Id: 0x%08x\n",pdcph.sourceL2Id );
|
||||
printk("[UE_IP_DRV] destinationL2Id Id: 0x%08x\n",pdcph.destinationL2Id );
|
||||
pdcph.sourceL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->saddr) & 0x00FFFFFF;
|
||||
pdcph.destinationL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->daddr) & 0x00FFFFFF;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
bytes_wrote = ue_ip_netlink_send((char *)&pdcph,UE_IP_PDCPH_SIZE);
|
||||
#ifdef OAI_DRV_DEBUG_SEND
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
|
||||
|
||||
#define UE_IP_NB_INSTANCES_MAX NUMBER_OF_UE_MAX
|
||||
#define UE_IP_NB_INSTANCES_MAX NUMBER_OF_UE_MAX /*MAX_MOBILES_PER_ENB*/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,13 +28,6 @@
|
||||
*/
|
||||
/*******************************************************************************/
|
||||
|
||||
#ifndef OAI_NW_DRIVER_USE_NETLINK
|
||||
#ifdef RTAI
|
||||
#include "rtai_posix.h"
|
||||
#define RTAI_IRQ 30 //try to get this irq with RTAI
|
||||
#endif // RTAI
|
||||
#endif // OAI_NW_DRIVER_USE_NETLINK
|
||||
|
||||
#include "constant.h"
|
||||
#include "local.h"
|
||||
#include "proto_extern.h"
|
||||
@@ -106,15 +99,29 @@ void *ue_ip_interrupt(void)
|
||||
}
|
||||
#endif //NETLINK
|
||||
//---------------------------------------------------------------------------
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
void ue_ip_timer(struct timer_list *t)
|
||||
#else
|
||||
void ue_ip_timer(unsigned long dataP)
|
||||
#endif
|
||||
{
|
||||
//---------------------------------------------------------------------------
|
||||
ue_ip_priv_t *priv_p=(ue_ip_priv_t *)dataP;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
ue_ip_priv_t *priv_p = from_timer(priv_p, t, timer);
|
||||
#else
|
||||
ue_ip_priv_t *priv_p = (ue_ip_priv_t *)dataP;
|
||||
#endif
|
||||
|
||||
spin_lock(&priv_p->lock);
|
||||
(priv_p->timer).function=ue_ip_timer;
|
||||
(priv_p->timer).expires=jiffies+UE_IP_TIMER_TICK;
|
||||
(priv_p->timer).data=dataP;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
mod_timer(&priv_p->timer, jiffies + UE_IP_TIMER_TICK);
|
||||
#else
|
||||
(priv_p->timer).function = ue_ip_timer;
|
||||
(priv_p->timer).expires = jiffies + UE_IP_TIMER_TICK;
|
||||
(priv_p->timer).data = dataP;
|
||||
add_timer(&priv_p->timer);
|
||||
#endif
|
||||
|
||||
spin_unlock(&priv_p->lock);
|
||||
return;
|
||||
// add_timer(&gpriv->timer);
|
||||
@@ -144,10 +151,15 @@ int ue_ip_open(struct net_device *dev_pP)
|
||||
netif_wake_queue(dev_pP);
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
|
||||
timer_setup(&(priv_p->timer), ue_ip_timer, 0);
|
||||
(priv_p->timer).expires = jiffies+UE_IP_TIMER_TICK;
|
||||
#else
|
||||
init_timer(&priv_p->timer);
|
||||
(priv_p->timer).expires = jiffies+UE_IP_TIMER_TICK;
|
||||
(priv_p->timer).data = (unsigned long)priv_p;
|
||||
(priv_p->timer).function = ue_ip_timer;
|
||||
#endif
|
||||
//add_timer(&priv_p->timer);
|
||||
|
||||
printk("[UE_IP_DRV][%s] name = %s\n", __FUNCTION__, dev_pP->name);
|
||||
@@ -243,7 +255,7 @@ int ue_ip_hard_start_xmit(struct sk_buff *skb_pP, struct net_device *dev_pP)
|
||||
|
||||
// End debug information
|
||||
netif_stop_queue(dev_pP);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796)
|
||||
netif_trans_update(dev_pP);
|
||||
#else
|
||||
dev_pP->trans_start = jiffies;
|
||||
@@ -319,7 +331,7 @@ void ue_ip_tx_timeout(struct net_device *dev_pP)
|
||||
printk("[UE_IP_DRV][%s] begin\n", __FUNCTION__);
|
||||
// (ue_ip_priv_t *)(dev_pP->priv_p)->stats.tx_errors++;
|
||||
(priv_p->stats).tx_errors++;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796)
|
||||
netif_trans_update(dev_pP);
|
||||
#else
|
||||
dev_pP->trans_start = jiffies;
|
||||
@@ -337,7 +349,11 @@ static const struct net_device_ops ue_ip_netdev_ops = {
|
||||
.ndo_set_mac_address = ue_ip_set_mac_address,
|
||||
.ndo_set_config = ue_ip_set_config,
|
||||
.ndo_do_ioctl = NULL,
|
||||
.ndo_change_mtu = ue_ip_change_mtu,
|
||||
#if RHEL_RELEASE_CODE>=1797
|
||||
.extended.ndo_change_mtu = ue_ip_change_mtu,
|
||||
#else
|
||||
.ndo_change_mtu = ue_ip_change_mtu,
|
||||
#endif
|
||||
.ndo_tx_timeout = ue_ip_tx_timeout,
|
||||
.ndo_change_rx_flags = ue_ip_change_rx_flags,
|
||||
};
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "platform_types.h"
|
||||
#include "sap.h"
|
||||
|
||||
#define MAKE_VERSION(a,b,c) ((a)*256+(b)*16+(c))
|
||||
|
||||
typedef struct ue_ip_priv_s {
|
||||
int irq;
|
||||
@@ -89,6 +90,10 @@ typedef struct pdcp_data_req_header_s {
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
ip_traffic_type_t traffic_type;
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uint32_t sourceL2Id;
|
||||
uint32_t destinationL2Id;
|
||||
#endif
|
||||
} pdcp_data_req_header_t;
|
||||
|
||||
typedef struct pdcp_data_ind_header_s {
|
||||
@@ -96,6 +101,10 @@ typedef struct pdcp_data_ind_header_s {
|
||||
sdu_size_t data_size;
|
||||
signed int inst;
|
||||
ip_traffic_type_t dummy_traffic_type;
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uint32_t sourceL2Id;
|
||||
uint32_t destinationL2Id;
|
||||
#endif
|
||||
} pdcp_data_ind_header_t;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user