summaryrefslogtreecommitdiffstats
path: root/package/ltq-dsl
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2011-03-14 07:34:08 +0000
committerJohn Crispin <john@openwrt.org>2011-03-14 07:34:08 +0000
commitcd3ff0e45c7b7786926b1e20c953551238e9d3b7 (patch)
tree45e6971439ad7c920ee0150f549dd0278b6b60ab /package/ltq-dsl
parentba3251a90d93e7b5d30a95a30f250ec6a7b08cf1 (diff)
downloadmaster-31e0f0ae-cd3ff0e45c7b7786926b1e20c953551238e9d3b7.tar.gz
master-31e0f0ae-cd3ff0e45c7b7786926b1e20c953551238e9d3b7.tar.bz2
master-31e0f0ae-cd3ff0e45c7b7786926b1e20c953551238e9d3b7.zip
* fixes .unlocked_ioctl functions
SVN-Revision: 26158
Diffstat (limited to 'package/ltq-dsl')
-rw-r--r--package/ltq-dsl/patches/100-dsl_compat.patch62
-rw-r--r--package/ltq-dsl/src/lantiq_mei.c20
2 files changed, 78 insertions, 4 deletions
diff --git a/package/ltq-dsl/patches/100-dsl_compat.patch b/package/ltq-dsl/patches/100-dsl_compat.patch
index 4897b33140..f892351a65 100644
--- a/package/ltq-dsl/patches/100-dsl_compat.patch
+++ b/package/ltq-dsl/patches/100-dsl_compat.patch
@@ -19,16 +19,70 @@
#include "drv_dsl_cpe_api.h"
#include "drv_dsl_cpe_api_ioctl.h"
-@@ -72,7 +73,7 @@
+@@ -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,
-- ioctl: DSL_DRV_Ioctls,
++#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
-@@ -1058,6 +1059,7 @@
+@@ -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)
{
@@ -36,7 +90,7 @@
DSL_int_t i;
printk(DSL_DRV_CRLF DSL_DRV_CRLF "Infineon CPE API Driver version: %s" DSL_DRV_CRLF,
-@@ -1104,7 +1106,8 @@
+@@ -1104,7 +1112,8 @@
}
DSL_DRV_DevNodeInit();
diff --git a/package/ltq-dsl/src/lantiq_mei.c b/package/ltq-dsl/src/lantiq_mei.c
index 062b0286f9..c236fa9dda 100644
--- a/package/ltq-dsl/src/lantiq_mei.c
+++ b/package/ltq-dsl/src/lantiq_mei.c
@@ -149,7 +149,11 @@ static int IFX_MEI_GetPage (DSL_DEV_Device_t *, u32, u32, u32, u32 *, u32 *);
static int IFX_MEI_BarUpdate (DSL_DEV_Device_t *, int);
static ssize_t IFX_MEI_Write (DSL_DRV_file_t *, const char *, size_t, loff_t *);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
static int IFX_MEI_UserIoctls (DSL_DRV_inode_t *, DSL_DRV_file_t *, unsigned int, unsigned long);
+#else
+static int IFX_MEI_UserIoctls (DSL_DRV_file_t *, unsigned int, unsigned long);
+#endif
static int IFX_MEI_Open (DSL_DRV_inode_t *, DSL_DRV_file_t *);
static int IFX_MEI_Release (DSL_DRV_inode_t *, DSL_DRV_file_t *);
@@ -200,7 +204,11 @@ static struct file_operations bsp_mei_operations = {
open:IFX_MEI_Open,
release:IFX_MEI_Release,
write:IFX_MEI_Write,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
+ ioctl:IFX_MEI_UserIoctls,
+#else
unlocked_ioctl:IFX_MEI_UserIoctls,
+#endif
};
static DSL_DEV_Device_t dsl_devices[BSP_MAX_DEVICES];
@@ -2662,16 +2670,28 @@ DSL_BSP_KernelIoctls (DSL_DEV_Device_t * pDev, unsigned int command,
return error;
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
static int
IFX_MEI_UserIoctls (DSL_DRV_inode_t * ino, DSL_DRV_file_t * fil,
unsigned int command, unsigned long lon)
+#else
+static int
+IFX_MEI_UserIoctls (DSL_DRV_file_t * fil,
+ unsigned int command, unsigned long lon)
+#endif
{
int error = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
int maj = MAJOR (ino->i_rdev);
int num = MINOR (ino->i_rdev);
+#endif
DSL_DEV_Device_t *pDev;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
pDev = IFX_BSP_HandleGet (maj, num);
+#else
+ pDev = IFX_BSP_HandleGet (0, 0);
+#endif
if (pDev == NULL)
return -EIO;