Files
LibreELEC.tv/packages/linux-drivers/RTL8192CU/patches/RTL8192CU-003-linux-3.10-proc_create-2.patch
Stephan Raue f3e1aa0b8f RTL8192CU: add kernel 3.10 patches
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2013-07-03 12:41:04 +02:00

93 lines
2.9 KiB
Diff

From e30a6db935752679770b31668e899a7b77e1fec4 Mon Sep 17 00:00:00 2001
From: kolasa <kkolasa@winsoft.pl>
Date: Mon, 13 May 2013 11:43:03 +0200
Subject: [PATCH] Usable /proc/net/rtl819xC/ver_info
---
.../core/rtw_debug.c | 9 +++++++++
.../include/rtw_debug.h | 5 ++++-
.../os_dep/linux/os_intfs.c | 14 +++++++++++++-
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/core/rtw_debug.c b/core/rtw_debug.c
index 04e472d..018fe48 100644
--- a/core/rtw_debug.c
+++ b/core/rtw_debug.c
@@ -62,6 +62,7 @@
#ifdef CONFIG_PROC_DEBUG
#include <rtw_version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
int proc_get_drv_version(char *page, char **start,
off_t offset, int count,
int *eof, void *data)
@@ -75,6 +76,14 @@ int proc_get_drv_version(char *page, char **start,
*eof = 1;
return len;
}
+#else
+int proc_get_drv_version(struct seq_file *m, void* data)
+{
+ struct net_device *dev = data;
+
+ return seq_printf(m, "%s\n", DRIVERVERSION);
+}
+#endif
int proc_get_write_reg(char *page, char **start,
off_t offset, int count,
diff --git a/include/rtw_debug.h b/include/rtw_debug.h
index eca6692..5b3e5cc 100644
--- a/include/rtw_debug.h
+++ b/include/rtw_debug.h
@@ -285,10 +285,13 @@
#ifdef CONFIG_PROC_DEBUG
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
int proc_get_drv_version(char *page, char **start,
off_t offset, int count,
int *eof, void *data);
-
+#else
+ int proc_get_drv_version(struct seq_file *m, void *data);
+#endif
int proc_get_write_reg(char *page, char **start,
off_t offset, int count,
int *eof, void *data);
diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c
index 99a5a1c..0e61bf9 100644
--- a/os_dep/linux/os_intfs.c
+++ b/os_dep/linux/os_intfs.c
@@ -255,6 +255,18 @@
static struct proc_dir_entry *rtw_proc = NULL;
static int rtw_proc_cnt = 0;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+static int drv_version_proc_open(struct inode *inode, struct file *file){
+ return single_open(file, proc_get_drv_version, NULL);
+}
+
+static const struct file_operations drv_version_fops = {
+ .open = drv_version_proc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+};
+#endif
+
void rtw_proc_init_one(struct net_device *dev)
{
struct proc_dir_entry *dir_dev = NULL;
@@ -289,7 +301,7 @@ void rtw_proc_init_one(struct net_device *dev)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
entry = create_proc_read_entry("ver_info", S_IFREG | S_IRUGO, rtw_proc, proc_get_drv_version, dev);
#else
- entry = proc_create_data("ver_info", S_IFREG | S_IRUGO, rtw_proc, proc_get_drv_version, dev);
+ entry = proc_create_data("ver_info", S_IFREG | S_IRUGO, rtw_proc, &drv_version_fops, dev);
#endif
if (!entry) {
DBG_871X("Unable to create_proc_read_entry!\n");
--
1.8.1.6