mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-14 23:50:37 +02:00
5e2ecb705a
* fixes .unlocked_ioctl functions git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26158 3c298f89-4303-0410-b956-a3cf2f4a3e73
126 lines
3.3 KiB
Diff
126 lines
3.3 KiB
Diff
--- a/src/include/drv_dsl_cpe_device_danube.h
|
|
+++ b/src/include/drv_dsl_cpe_device_danube.h
|
|
@@ -24,7 +24,7 @@
|
|
#include "drv_dsl_cpe_simulator_danube.h"
|
|
#else
|
|
/* Include for the low level driver interface header file */
|
|
-#include "asm/ifx/ifx_mei_bsp.h"
|
|
+#include "mei/ifxmips_mei_interface.h"
|
|
#endif /* defined(DSL_CPE_SIMULATOR_DRIVER) && defined(WIN32)*/
|
|
|
|
#define DSL_MAX_LINE_NUMBER 1
|
|
--- a/src/common/drv_dsl_cpe_os_linux.c
|
|
+++ b/src/common/drv_dsl_cpe_os_linux.c
|
|
@@ -11,6 +11,7 @@
|
|
#ifdef __LINUX__
|
|
|
|
#define DSL_INTERN
|
|
+#include <linux/device.h>
|
|
|
|
#include "drv_dsl_cpe_api.h"
|
|
#include "drv_dsl_cpe_api_ioctl.h"
|
|
@@ -34,9 +35,13 @@
|
|
static DSL_ssize_t DSL_DRV_Write(DSL_DRV_file_t *pFile, const DSL_char_t * pBuf,
|
|
DSL_DRV_size_t nSize, DSL_DRV_offset_t * pLoff);
|
|
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
|
|
static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_inode_t * pINode, DSL_DRV_file_t * pFile,
|
|
DSL_uint_t nCommand, unsigned long nArg);
|
|
-
|
|
+#else
|
|
+static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_file_t * pFile,
|
|
+ DSL_uint_t nCommand, unsigned long nArg);
|
|
+#endif
|
|
static int DSL_DRV_Open(DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil);
|
|
|
|
static int DSL_DRV_Release(DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil);
|
|
@@ -72,7 +77,11 @@
|
|
open: DSL_DRV_Open,
|
|
release: DSL_DRV_Release,
|
|
write: DSL_DRV_Write,
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
|
|
ioctl: DSL_DRV_Ioctls,
|
|
+#else
|
|
+ unlocked_ioctl: DSL_DRV_Ioctls,
|
|
+#endif
|
|
poll: DSL_DRV_Poll
|
|
};
|
|
#else
|
|
@@ -168,10 +177,17 @@
|
|
\return Success or failure.
|
|
\ingroup Internal
|
|
*/
|
|
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
|
|
static DSL_int_t DSL_DRV_Ioctls(DSL_DRV_inode_t * pINode,
|
|
DSL_DRV_file_t * pFile,
|
|
DSL_uint_t nCommand,
|
|
unsigned long nArg)
|
|
+#else
|
|
+static DSL_int_t DSL_DRV_Ioctls(
|
|
+ DSL_DRV_file_t * pFile,
|
|
+ DSL_uint_t nCommand,
|
|
+ unsigned long nArg)
|
|
+#endif
|
|
{
|
|
DSL_int_t nErr=0;
|
|
DSL_boolean_t bIsInKernel;
|
|
@@ -216,16 +232,7 @@
|
|
}
|
|
}
|
|
}
|
|
-
|
|
- if (pINode == DSL_NULL)
|
|
- {
|
|
- bIsInKernel = DSL_TRUE;
|
|
- }
|
|
- else
|
|
- {
|
|
- bIsInKernel = DSL_FALSE;
|
|
- }
|
|
-
|
|
+ bIsInKernel = DSL_FALSE;
|
|
if ( (_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API) ||
|
|
(_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_G997) ||
|
|
(_IOC_TYPE(nCommand) == DSL_IOC_MAGIC_CPE_API_PM) ||
|
|
@@ -1058,6 +1065,7 @@
|
|
/* Entry point of driver */
|
|
int __init DSL_ModuleInit(void)
|
|
{
|
|
+ struct class *dsl_class;
|
|
DSL_int_t i;
|
|
|
|
printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF,
|
|
@@ -1104,7 +1112,8 @@
|
|
}
|
|
|
|
DSL_DRV_DevNodeInit();
|
|
-
|
|
+ dsl_class = class_create(THIS_MODULE, "dsl_cpe_api");
|
|
+ device_create(dsl_class, NULL, MKDEV(DRV_DSL_CPE_API_DEV_MAJOR, 0), NULL, "dsl_cpe_api");
|
|
return 0;
|
|
}
|
|
|
|
--- a/src/include/drv_dsl_cpe_os_linux.h
|
|
+++ b/src/include/drv_dsl_cpe_os_linux.h
|
|
@@ -17,17 +17,17 @@
|
|
#endif
|
|
|
|
#include <asm/ioctl.h>
|
|
-#include <linux/autoconf.h>
|
|
+#include <generated/autoconf.h>
|
|
#include <linux/module.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/init.h>
|
|
#include <linux/ctype.h>
|
|
#include <linux/version.h>
|
|
#include <linux/spinlock.h>
|
|
-
|
|
+#include <linux/sched.h>
|
|
|
|
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17))
|
|
- #include <linux/utsrelease.h>
|
|
+ #include <generated/utsrelease.h>
|
|
#endif
|
|
|
|
#include <linux/types.h>
|