branch LG_PRE_RELEASE_0.3 reintegration

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7117 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Lionel Gauthier
2015-04-10 13:18:11 +00:00
parent 4f583e2053
commit 56c9000558
227 changed files with 11342 additions and 10069 deletions
+1
View File
@@ -0,0 +1 @@
This the driver for the UE when NAS layer is running in the UE (EPC setting).
+7 -4
View File
@@ -115,8 +115,9 @@ ue_ip_common_class_wireless2ip(
#ifdef OAI_DRV_DEBUG_RECEIVE
printk("[UE_IP_DRV][%s] Receiving packet of size %d from PDCP \n",__FUNCTION__, skb_p->len);
for (i=0; i<skb_p->len; i++)
for (i=0; i<skb_p->len; i++) {
printk("%2x ",((unsigned char *)(skb_p->data))[i]);
}
printk("\n");
#endif
@@ -131,7 +132,7 @@ ue_ip_common_class_wireless2ip(
skb_p->ip_summed = CHECKSUM_UNNECESSARY;
ipv_p = (ipversion_t *)((void*)&(skb_p->data[hard_header_len]));
ipv_p = (struct ipversion*)((void*)&(skb_p->data[hard_header_len]));
switch (ipv_p->version) {
@@ -224,8 +225,9 @@ ue_ip_common_class_wireless2ip(
#ifdef OAI_DRV_DEBUG_RECEIVE
printk("[UE_IP_DRV][%s] sending packet of size %d to kernel\n",__FUNCTION__,skb_p->len);
for (i=0; i<skb_p->len; i++)
for (i=0; i<skb_p->len; i++) {
printk("%2x ",((unsigned char *)(skb_p->data))[i]);
}
printk("\n");
#endif //OAI_DRV_DEBUG_RECEIVE
@@ -318,8 +320,9 @@ ue_ip_common_ip2wireless(
#ifdef OAI_DRV_DEBUG_SEND
printk("[UE_IP_DRV][%s] Sending packet of size %d to PDCP \n",__FUNCTION__,skb_pP->len);
for (j=0; j<skb_pP->len; j++)
for (j=0; j<skb_pP->len; j++) {
printk("%2x ",((unsigned char *)(skb_pP->data))[j]);
}
printk("\n");
#endif
+16 -10
View File
@@ -77,8 +77,9 @@ int ue_ip_find_inst(struct net_device *dev_pP)
int i;
for (i=0; i<UE_IP_NB_INSTANCES_MAX; i++)
if (ue_ip_dev[i] == dev_pP)
if (ue_ip_dev[i] == dev_pP) {
return(i);
}
return(-1);
}
@@ -145,10 +146,11 @@ int ue_ip_open(struct net_device *dev_pP)
#endif //OAI_NW_DRIVER_USE_NETLINK
if(!netif_queue_stopped(dev_pP))
if(!netif_queue_stopped(dev_pP)) {
netif_start_queue(dev_pP);
else
} else {
netif_wake_queue(dev_pP);
}
init_timer(&priv_p->timer);
(priv_p->timer).expires = jiffies+UE_IP_TIMER_TICK;
@@ -206,16 +208,18 @@ int ue_ip_set_config(struct net_device *dev_pP, struct ifmap *map_pP)
//---------------------------------------------------------------------------
printk("[UE_IP_DRV][%s] Begin\n", __FUNCTION__);
if (dev_pP->flags & IFF_UP)
if (dev_pP->flags & IFF_UP) {
return -EBUSY;
}
if (map_pP->base_addr != dev_pP->base_addr) {
printk(KERN_WARNING "[UE_IP_DRV][%s] Can't change I/O address\n", __FUNCTION__);
return -EOPNOTSUPP;
}
if (map_pP->irq != dev_pP->irq)
if (map_pP->irq != dev_pP->irq) {
dev_pP->irq = map_pP->irq;
}
printk("[UE_IP_DRV][%s] End\n", __FUNCTION__);
return 0;
@@ -293,8 +297,9 @@ int ue_ip_change_mtu(struct net_device *dev_pP, int mtuP)
//---------------------------------------------------------------------------
printk("[UE_IP_DRV][%s] CHANGE MTU %d bytes\n", __FUNCTION__, mtuP);
if ((mtuP<50) || (mtuP>1500))
if ((mtuP<50) || (mtuP>1500)) {
return -EINVAL;
}
dev_pP->mtu = mtuP;
return 0;
@@ -397,8 +402,9 @@ int init_module (void)
printk("[UE_IP_DRV][%s] NETLINK INIT\n", __FUNCTION__);
if ((err=ue_ip_netlink_init()) == -1)
if ((err=ue_ip_netlink_init()) == -1) {
printk("[UE_IP_DRV][%s] NETLINK failed\n", __FUNCTION__);
}
return err;
@@ -410,11 +416,11 @@ void cleanup_module(void)
//---------------------------------------------------------------------------
int inst;
printk("[UE_IP_DRV][CLEANUP]nasmesh_cleanup_module: begin\n");
printk("[UE_IP_DRV][CLEANUP] begin\n");
for (inst=0; inst<UE_IP_NB_INSTANCES_MAX; inst++) {
#ifdef OAI_DRV_DEBUG_DEVICE
printk("nasmesh_cleanup_module: unregister and free net device instance %d\n",inst);
printk("[UE_IP_DRV][CLEANUP] unregister and free net device instance %d\n",inst);
#endif
if (ue_ip_dev[inst]) {
@@ -425,7 +431,7 @@ void cleanup_module(void)
}
ue_ip_netlink_release();
printk("nasmesh_cleanup_module: end\n");
printk("[UE_IP_DRV][CLEANUP] end\n");
}
#define DRV_NAME "ue_ip"
+1 -1
View File
@@ -75,7 +75,7 @@ typedef struct ue_ip_priv_s {
uint32_t timer_release;
struct sock *nl_sk;
uint8_t nlmsg[UE_IP_PRIMITIVE_MAX_LENGTH+sizeof(struct nlmsghdr)];
uint8_t xbuffer[UE_IP_PRIMITIVE_MAX_LENGTH]; // transmition buffer
uint8_t xbuffer[UE_IP_PRIMITIVE_MAX_LENGTH]; // transmission buffer
uint8_t rbuffer[UE_IP_PRIMITIVE_MAX_LENGTH]; // reception buffer
} ue_ip_priv_t;
+16 -7
View File
@@ -47,7 +47,7 @@
#include "proto_extern.h"
#define NAS_NETLINK_ID 31
#define OAI_IP_DRIVER_NETLINK_ID 31
#define NL_DEST_PID 1
/*******************************************************************************
@@ -106,18 +106,27 @@ int ue_ip_netlink_init(void)
printk("[UE_IP_DRV][NETLINK] Running init ...\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
cfg.groups = 0;
cfg.input = nas_nl_data_ready;
cfg.cb_mutex = &nasmesh_mutex;
cfg.bind = NULL;
nas_nl_sk = netlink_kernel_create(
&init_net,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
NAS_NETLINK_ID,
OAI_IP_DRIVER_NETLINK_ID,
# if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
THIS_MODULE,
# endif
&cfg
#else
NAS_NETLINK_ID,
#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
nas_nl_sk = netlink_kernel_create(
&init_net,
OAI_IP_DRIVER_NETLINK_ID,
0,
nas_nl_data_ready,
&nasmesh_mutex, // NULL
THIS_MODULE
#endif
THIS_MODULE);
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
);