changeset 15:1011e450be45

Update to allow compile with 2.6.31
author AngelCarpintero
date Fri, 11 Sep 2009 10:02:42 +0000
parents 647e63ddab46
children 2dbe2489381e
files vloopback.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/vloopback.c	Wed Jul 08 10:07:31 2009 +0000
+++ b/vloopback.c	Fri Sep 11 10:02:42 2009 +0000
@@ -156,6 +156,11 @@
  * 17.05.09    (Peter Holik)
  *            Patch to allow work with kernel 2.6.29  
  *
+ * 05.08.09   (Angel Carpintero)
+ *            Allow to compile with kernel 2.6.30.*
+ *
+ * 11.09.09   (Angel Carpintero)
+ *            Allow to compile with kernel 2.6.31
  */
 
 
@@ -178,11 +183,17 @@
 
 /* v4l_compat_ioctl32 */ 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ #ifdef __KERNEL__
+  #undef __KERNEL__
+ #endif
  #include <media/v4l2-ioctl.h>
 #endif
 
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)
  #define vd_private_data dev.driver_data
+ #ifndef __KERNEL__
+  #define __KERNEL__
+ #endif
 #else
  #define vd_private_data priv
 #endif
@@ -191,6 +202,7 @@
 #include <linux/vmalloc.h>
 #include <linux/wait.h>
 
+
 /* Include files which are unique to versions */
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
  #include <asm/ioctl.h>
@@ -430,6 +442,8 @@
         }
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
         loops[nr]->pid = current->pid;
+#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)        
+        loops[nr]->pid = find_pid_ns(current->pid,0);
 #else
         // TODO : Check in stable 2.6.27
         loops[nr]->pid = task_pid(find_task_by_vpid(current->pid));