No diffs!
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4954 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
* \author Raymond knopp, and Navid Nikaein, Lionel Gauthier
|
* \author Raymond knopp, and Navid Nikaein, Lionel Gauthier
|
||||||
* \company Eurecom
|
* \company Eurecom
|
||||||
* \email: knopp@eurecom.fr, and navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
|
* \email: knopp@eurecom.fr, and navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#include <linux/config.h>
|
//#include <linux/config.h>
|
||||||
#include <linux/socket.h>
|
#include <linux/socket.h>
|
||||||
@@ -94,31 +94,31 @@ static void nas_nl_data_ready (struct sk_buff *skb)
|
|||||||
static struct task_struct *netlink_rx_thread;
|
static struct task_struct *netlink_rx_thread;
|
||||||
|
|
||||||
// this thread is used to avoid blocking other system calls from entering the kernel
|
// this thread is used to avoid blocking other system calls from entering the kernel
|
||||||
static int nas_netlink_rx_thread(void *data) {
|
static int nas_netlink_rx_thread(void *data) {
|
||||||
|
|
||||||
int err;
|
int err;
|
||||||
struct sk_buff *skb = NULL;
|
struct sk_buff *skb = NULL;
|
||||||
struct nlmsghdr *nlh = NULL;
|
struct nlmsghdr *nlh = NULL;
|
||||||
|
|
||||||
printk("[UE_IP_DRV][NETLINK] Starting RX Thread \n");
|
printk("[UE_IP_DRV][NETLINK] Starting RX Thread \n");
|
||||||
|
|
||||||
while (!kthread_should_stop()) {
|
while (!kthread_should_stop()) {
|
||||||
|
|
||||||
if (nas_nl_sk) {
|
if (nas_nl_sk) {
|
||||||
skb = skb_recv_datagram(nas_nl_sk, 0, 0, &err);
|
skb = skb_recv_datagram(nas_nl_sk, 0, 0, &err);
|
||||||
|
|
||||||
if (skb) {
|
if (skb) {
|
||||||
|
|
||||||
#ifdef NETLINK_DEBUG
|
#ifdef NETLINK_DEBUG
|
||||||
printk("[UE_IP_DRV][NETLINK] Received socket from PDCP\n");
|
printk("[UE_IP_DRV][NETLINK] Received socket from PDCP\n");
|
||||||
#endif //NETLINK_DEBUG
|
#endif //NETLINK_DEBUG
|
||||||
nlh = (struct nlmsghdr *)skb->data;
|
nlh = (struct nlmsghdr *)skb->data;
|
||||||
|
|
||||||
nas_COMMON_QOS_receive(nlh);
|
nas_COMMON_QOS_receive(nlh);
|
||||||
|
|
||||||
skb_free_datagram(nas_nl_sk,skb);
|
skb_free_datagram(nas_nl_sk,skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (exit_netlink_thread == 1) {
|
if (exit_netlink_thread == 1) {
|
||||||
@@ -127,16 +127,16 @@ static int nas_netlink_rx_thread(void *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // while
|
} // while
|
||||||
|
|
||||||
printk("[UE_IP_DRV][NETLINK] Exiting RX thread\n");
|
printk("[UE_IP_DRV][NETLINK] Exiting RX thread\n");
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nas_nl_data_ready (struct sock *sk, int len)
|
static void nas_nl_data_ready (struct sock *sk, int len)
|
||||||
|
|
||||||
{
|
{
|
||||||
wake_up_interruptible(sk->sk_sleep);
|
wake_up_interruptible(sk->sk_sleep);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -146,15 +146,15 @@ int ue_ip_netlink_init(void)
|
|||||||
{
|
{
|
||||||
|
|
||||||
printk("[UE_IP_DRV][NETLINK] Running init ...\n");
|
printk("[UE_IP_DRV][NETLINK] Running init ...\n");
|
||||||
|
|
||||||
|
|
||||||
nas_nl_sk = netlink_kernel_create(
|
nas_nl_sk = netlink_kernel_create(
|
||||||
#ifdef KERNEL_VERSION_GREATER_THAN_2622
|
#ifdef KERNEL_VERSION_GREATER_THAN_2622
|
||||||
&init_net,
|
&init_net,
|
||||||
#endif
|
#endif
|
||||||
NAS_NETLINK_ID,
|
NAS_NETLINK_ID,
|
||||||
0,
|
0,
|
||||||
nas_nl_data_ready,
|
nas_nl_data_ready,
|
||||||
#ifdef KERNEL_VERSION_GREATER_THAN_2622
|
#ifdef KERNEL_VERSION_GREATER_THAN_2622
|
||||||
&nasmesh_mutex, // NULL
|
&nasmesh_mutex, // NULL
|
||||||
#endif
|
#endif
|
||||||
@@ -168,14 +168,14 @@ int ue_ip_netlink_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KERNEL_VERSION_GREATER_THAN_2629
|
#ifdef KERNEL_VERSION_GREATER_THAN_2629
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// Create receive thread
|
// Create receive thread
|
||||||
netlink_rx_thread = kthread_run(nas_netlink_rx_thread, NULL, "NAS_NETLINK_RX_THREAD");
|
netlink_rx_thread = kthread_run(nas_netlink_rx_thread, NULL, "NAS_NETLINK_RX_THREAD");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -183,16 +183,16 @@ void ue_ip_netlink_release(void) {
|
|||||||
|
|
||||||
exit_netlink_thread=1;
|
exit_netlink_thread=1;
|
||||||
printk("[UE_IP_DRV][NETLINK] Releasing netlink socket\n");
|
printk("[UE_IP_DRV][NETLINK] Releasing netlink socket\n");
|
||||||
|
|
||||||
if(nas_nl_sk){
|
if(nas_nl_sk){
|
||||||
#ifdef KERNEL_VERSION_GREATER_THAN_2629
|
#ifdef KERNEL_VERSION_GREATER_THAN_2629
|
||||||
netlink_kernel_release(nas_nl_sk); //or skb->sk
|
netlink_kernel_release(nas_nl_sk); //or skb->sk
|
||||||
#else
|
#else
|
||||||
sock_release(nas_nl_sk->sk_socket);
|
sock_release(nas_nl_sk->sk_socket);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// printk("[UE_IP_DRV][NETLINK] Removing netlink_rx_thread\n");
|
// printk("[UE_IP_DRV][NETLINK] Removing netlink_rx_thread\n");
|
||||||
//kthread_stop(netlink_rx_thread);
|
//kthread_stop(netlink_rx_thread);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user