Mercurial > vloopback
comparison vloopback.c @ 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 |
comparison
equal
deleted
inserted
replaced
14:647e63ddab46 | 15:1011e450be45 |
---|---|
154 * Allow build with kernel 2.6.28 and 2.6.27.git ( struct video_dev has not priv member anymore). | 154 * Allow build with kernel 2.6.28 and 2.6.27.git ( struct video_dev has not priv member anymore). |
155 * | 155 * |
156 * 17.05.09 (Peter Holik) | 156 * 17.05.09 (Peter Holik) |
157 * Patch to allow work with kernel 2.6.29 | 157 * Patch to allow work with kernel 2.6.29 |
158 * | 158 * |
159 * 05.08.09 (Angel Carpintero) | |
160 * Allow to compile with kernel 2.6.30.* | |
161 * | |
162 * 11.09.09 (Angel Carpintero) | |
163 * Allow to compile with kernel 2.6.31 | |
159 */ | 164 */ |
160 | 165 |
161 | 166 |
162 #define VLOOPBACK_VERSION "1.3-trunk" | 167 #define VLOOPBACK_VERSION "1.3-trunk" |
163 | 168 |
176 #include <media/v4l2-common.h> | 181 #include <media/v4l2-common.h> |
177 #endif | 182 #endif |
178 | 183 |
179 /* v4l_compat_ioctl32 */ | 184 /* v4l_compat_ioctl32 */ |
180 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) | 185 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) |
186 #ifdef __KERNEL__ | |
187 #undef __KERNEL__ | |
188 #endif | |
181 #include <media/v4l2-ioctl.h> | 189 #include <media/v4l2-ioctl.h> |
182 #endif | 190 #endif |
183 | 191 |
184 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27) | 192 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27) |
185 #define vd_private_data dev.driver_data | 193 #define vd_private_data dev.driver_data |
194 #ifndef __KERNEL__ | |
195 #define __KERNEL__ | |
196 #endif | |
186 #else | 197 #else |
187 #define vd_private_data priv | 198 #define vd_private_data priv |
188 #endif | 199 #endif |
189 | 200 |
190 #include <linux/videodev.h> | 201 #include <linux/videodev.h> |
191 #include <linux/vmalloc.h> | 202 #include <linux/vmalloc.h> |
192 #include <linux/wait.h> | 203 #include <linux/wait.h> |
204 | |
193 | 205 |
194 /* Include files which are unique to versions */ | 206 /* Include files which are unique to versions */ |
195 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) | 207 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) |
196 #include <asm/ioctl.h> | 208 #include <asm/ioctl.h> |
197 #include <asm/page.h> | 209 #include <asm/page.h> |
428 nr_o_pipes++; | 440 nr_o_pipes++; |
429 } | 441 } |
430 } | 442 } |
431 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) | 443 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) |
432 loops[nr]->pid = current->pid; | 444 loops[nr]->pid = current->pid; |
445 #elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30) | |
446 loops[nr]->pid = find_pid_ns(current->pid,0); | |
433 #else | 447 #else |
434 // TODO : Check in stable 2.6.27 | 448 // TODO : Check in stable 2.6.27 |
435 loops[nr]->pid = task_pid(find_task_by_vpid(current->pid)); | 449 loops[nr]->pid = task_pid(find_task_by_vpid(current->pid)); |
436 //loops[nr]->pid = task_pid(current); | 450 //loops[nr]->pid = task_pid(current); |
437 #endif | 451 #endif |