mirror of
https://github.com/breeze303/nss-packages.git
synced 2025-12-16 08:44:52 +00:00
There are significant changes between NSS version 11.4.0.5 and 12.1 (12.0.5), that it doesn't really make sense to use it with older firmware (i.e. using mesh releated features). This change will explicitly link building the proper driver and client packages when FW 12.1 or 11.4 is selected, while also backporting patches from 12.4.
62 lines
1.4 KiB
Diff
62 lines
1.4 KiB
Diff
--- a/profiler/profile.c
|
|
+++ b/profiler/profile.c
|
|
@@ -31,6 +31,7 @@
|
|
#include <linux/fs.h>
|
|
#include <linux/page-flags.h>
|
|
#include <linux/sched.h>
|
|
+#include <linux/version.h>
|
|
#include <asm/uaccess.h>
|
|
#include <asm/page.h>
|
|
#include <asm/thread_info.h>
|
|
@@ -937,12 +938,26 @@ static ssize_t debug_if(struct file *fil
|
|
return count;
|
|
}
|
|
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
|
|
+#define HAVE_PROC_OPS
|
|
+#endif
|
|
+
|
|
+#ifdef HAVE_PROC_OPS
|
|
+static const struct proc_ops profile_fops = {
|
|
+ .proc_open = profile_open,
|
|
+ .proc_read = profile_read,
|
|
+ .proc_lseek = seq_lseek,
|
|
+ .proc_release = profile_release,
|
|
+ .proc_write = debug_if,
|
|
+};
|
|
+#else
|
|
static const struct file_operations profile_fops = {
|
|
.open = profile_open,
|
|
.read = profile_read,
|
|
.release = profile_release,
|
|
.write = debug_if,
|
|
};
|
|
+#endif
|
|
|
|
/*
|
|
* showing sample status on Linux console
|
|
@@ -971,6 +986,15 @@ static ssize_t profile_rate_write(struct
|
|
return 0;
|
|
}
|
|
|
|
+#ifdef HAVE_PROC_OPS
|
|
+static const struct proc_ops profile_rate_fops = {
|
|
+ .proc_open = profile_rate_open,
|
|
+ .proc_read = seq_read,
|
|
+ .proc_lseek = seq_lseek,
|
|
+ .proc_release = single_release,
|
|
+ .proc_write = profile_rate_write,
|
|
+};
|
|
+#else
|
|
static const struct file_operations profile_rate_fops = {
|
|
.open = profile_rate_open,
|
|
.read = seq_read,
|
|
@@ -978,6 +1002,7 @@ static const struct file_operations prof
|
|
.release = single_release,
|
|
.write = profile_rate_write,
|
|
};
|
|
+#endif
|
|
|
|
/*
|
|
* hexdump
|