Commit 8b6ab54a authored by Lionel Gauthier's avatar Lionel Gauthier

No diffs!

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4954 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 2bb20ac2
......@@ -31,7 +31,7 @@
* \author Raymond knopp, and Navid Nikaein, Lionel Gauthier
* \company Eurecom
* \email: knopp@eurecom.fr, and navid.nikaein@eurecom.fr, lionel.gauthier@eurecom.fr
*/
*/
//#include <linux/config.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;
// 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;
struct sk_buff *skb = NULL;
struct nlmsghdr *nlh = NULL;
printk("[UE_IP_DRV][NETLINK] Starting RX Thread \n");
while (!kthread_should_stop()) {
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) {
#ifdef NETLINK_DEBUG
printk("[UE_IP_DRV][NETLINK] Received socket from PDCP\n");
#endif //NETLINK_DEBUG
nlh = (struct nlmsghdr *)skb->data;
nas_COMMON_QOS_receive(nlh);
skb_free_datagram(nas_nl_sk,skb);
}
}
else {
if (exit_netlink_thread == 1) {
......@@ -127,16 +127,16 @@ static int nas_netlink_rx_thread(void *data) {
}
}
} // while
printk("[UE_IP_DRV][NETLINK] Exiting RX thread\n");
return(0);
}
static void nas_nl_data_ready (struct sock *sk, int len)
{
{
wake_up_interruptible(sk->sk_sleep);
}
#endif
......@@ -146,15 +146,15 @@ int ue_ip_netlink_init(void)
{
printk("[UE_IP_DRV][NETLINK] Running init ...\n");
nas_nl_sk = netlink_kernel_create(
#ifdef KERNEL_VERSION_GREATER_THAN_2622
&init_net,
&init_net,
#endif
NAS_NETLINK_ID,
0,
nas_nl_data_ready,
NAS_NETLINK_ID,
0,
nas_nl_data_ready,
#ifdef KERNEL_VERSION_GREATER_THAN_2622
&nasmesh_mutex, // NULL
#endif
......@@ -168,14 +168,14 @@ int ue_ip_netlink_init(void)
}
#ifdef KERNEL_VERSION_GREATER_THAN_2629
#else
// Create receive thread
netlink_rx_thread = kthread_run(nas_netlink_rx_thread, NULL, "NAS_NETLINK_RX_THREAD");
#endif
return(0);
}
......@@ -183,16 +183,16 @@ void ue_ip_netlink_release(void) {
exit_netlink_thread=1;
printk("[UE_IP_DRV][NETLINK] Releasing netlink socket\n");
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
#else
sock_release(nas_nl_sk->sk_socket);
#endif
}
// printk("[UE_IP_DRV][NETLINK] Removing netlink_rx_thread\n");
//kthread_stop(netlink_rx_thread);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment