mwprocapture: 1.2.3589 -> 1.2.3773

also refactor linux 4.14 patch, and remove 4.13 patch as it is upstream
This commit is contained in:
Cray Elliott 2017-12-23 22:16:48 -08:00
parent 159a72bd55
commit 5e38fc024b
3 changed files with 23 additions and 26 deletions

View File

@ -18,15 +18,14 @@ let
in
stdenv.mkDerivation rec {
name = "mwprocapture-1.2.${version}-${kernel.version}";
version = "3589";
version = "3773";
src = fetchurl {
url = "http://www.magewell.com/files/ProCaptureForLinux_${version}.tar.gz";
sha256 = "1arwnwrq52rs8g9zfxw8saip40vc3201sf7qnbqd2p23h8vzwb8i";
url = "http://www.magewell.com/files/drivers/ProCaptureForLinux_${version}.tar.gz";
sha256 = "1ri7c4l4xgkhpz0f15jra1p7mpzi8ir6lpwjm7q7hc9m4cvxcs1g";
};
patches = [] ++ optional (versionAtLeast kernel.version "4.13") ./linux_4_13_fix.patch
++ optional (versionAtLeast kernel.version "4.14") ./linux_4_14_fix.patch;
patches = [ ./linux_4_14_fix.patch ];
preConfigure =
''

View File

@ -1,12 +0,0 @@
diff -Naur ProCaptureForLinux_3589/src/sources/ospi/ospi-linux.h ProCaptureForLinux_3589_new/src/sources/ospi/ospi-linux.h
--- ProCaptureForLinux_3589/src/sources/ospi/ospi-linux.h 2017-08-17 02:46:07.000000000 -0700
+++ ProCaptureForLinux_3589_new/src/sources/ospi/ospi-linux.h 2017-09-03 18:13:31.843510536 -0700
@@ -172,7 +172,7 @@
#else
struct completion done;
#endif
- wait_queue_t waitq; // for multi wait
+ wait_queue_entry_t waitq; // for multi wait
};
typedef struct _os_event_t *os_event_t;

View File

@ -1,6 +1,6 @@
diff -Naur ProCaptureForLinux_3589/src/sources/ospi/linux-file.c ProCaptureForLinux_3589_new/src/sources/ospi/linux-file.c
--- ProCaptureForLinux_3589/src/sources/ospi/linux-file.c 2017-08-17 02:46:07.000000000 -0700
+++ ProCaptureForLinux_3589_new/src/sources/ospi/linux-file.c 2017-11-13 20:18:50.842947380 -0800
diff -Naur ProCaptureForLinux_3773/src/sources/ospi/linux-file.c ProCaptureForLinux_3773_new/src/sources/ospi/linux-file.c
--- ProCaptureForLinux_3773/src/sources/ospi/linux-file.c 2017-12-15 01:59:57.000000000 -0800
+++ ProCaptureForLinux_3773_new/src/sources/ospi/linux-file.c 2017-12-23 22:14:08.351092413 -0800
@@ -7,8 +7,8 @@
#include "linux-file.h"
@ -11,41 +11,51 @@ diff -Naur ProCaptureForLinux_3589/src/sources/ospi/linux-file.c ProCaptureForLi
struct file *linux_file_open(const char *path, int flags, int mode)
{
@@ -28,27 +28,27 @@
@@ -28,29 +28,36 @@
filp_close(file, NULL);
}
-ssize_t linux_file_read(struct file *file, loff_t offset, unsigned char *data, size_t size)
+ssize_t linux_file_read(struct file *file, loff_t offset, const void *data, size_t size)
{
+#if defined(HAVE_KERNEL_WRITE_PPOS)
+ return(kernel_read(file, data, size, &offset));
+#else
mm_segment_t oldfs;
ssize_t ret;
oldfs = get_fs();
set_fs(get_ds());
- ret = vfs_read(file, data, size, &offset);
+ ret = kernel_read(file, data, size, &offset);
+ ret = vfs_read(file, (unsigned char *)data, size, &offset);
set_fs(oldfs);
return ret;
+#endif
}
-ssize_t linux_file_write(struct file *file, loff_t offset, unsigned char *data, size_t size)
+ssize_t linux_file_write(struct file *file, loff_t offset, const void *data, size_t size)
{
+#if defined(HAVE_KERNEL_WRITE_PPOS)
+ return(kernel_write(file, data, size, &offset));
+#else
mm_segment_t oldfs;
ssize_t ret;
oldfs = get_fs();
set_fs(get_ds());
- ret = vfs_write(file, data, size, &offset);
+ ret = kernel_write(file, data, size, &offset);
+ ret = vfs_write(file, (unsigned char *)data, size, &offset);
set_fs(oldfs);
return ret;
diff -Naur ProCaptureForLinux_3589/src/sources/ospi/linux-file.h ProCaptureForLinux_3589_new/src/sources/ospi/linux-file.h
--- ProCaptureForLinux_3589/src/sources/ospi/linux-file.h 2017-08-17 02:46:07.000000000 -0700
+++ ProCaptureForLinux_3589_new/src/sources/ospi/linux-file.h 2017-11-13 20:24:20.979690346 -0800
+#endif
}
-
diff -Naur ProCaptureForLinux_3773/src/sources/ospi/linux-file.h ProCaptureForLinux_3773_new/src/sources/ospi/linux-file.h
--- ProCaptureForLinux_3773/src/sources/ospi/linux-file.h 2017-12-15 01:59:57.000000000 -0800
+++ ProCaptureForLinux_3773_new/src/sources/ospi/linux-file.h 2017-12-23 21:57:18.263237473 -0800
@@ -13,9 +13,9 @@
void linux_file_close(struct file *file);