d311d44a85ef7b111c3341d31a4d00c10ea252de
[openwrt.git] / package / ltq-vmmc / patches / 200-kernel-37.patch
1 --- a/src/drv_vmmc_init.c
2 +++ b/src/drv_vmmc_init.c
3 @@ -784,7 +784,7 @@ IFX_int32_t VMMC_TAPI_LL_FW_Start(IFX_TA
4        dwld.fwDwld.length = IoInit.pram_size;
5  
6       /* download firmware */
7 -      ret = ifx_mps_ioctl((IFX_void_t *) command, IFX_NULL, FIO_MPS_DOWNLOAD,
8 +      ret = ifx_mps_ioctl((IFX_void_t *) command, FIO_MPS_DOWNLOAD,
9                            (IFX_uint32_t) &dwld.fwDwld);
10     }
11  
12 @@ -1594,7 +1594,7 @@ IFX_void_t VMMC_DeviceDriverStop(IFX_voi
13  #ifdef VMMC_DRIVER_UNLOAD_HOOK
14     if (VDevices[0].nDevState & DS_GPIO_RESERVED)
15     {
16 -      IFX_int32_t ret;
17 +      IFX_int32_t ret = 0;
18        VMMC_DRIVER_UNLOAD_HOOK(ret);
19        if (!VMMC_SUCCESS(ret))
20        {
21 --- a/src/mps/drv_mps_vmmc_linux.c
22 +++ b/src/mps/drv_mps_vmmc_linux.c
23 @@ -110,7 +110,7 @@ IFX_int32_t ifx_mps_get_status_proc (IFX
24  #ifndef __KERNEL__
25  IFX_int32_t ifx_mps_open (struct inode *inode, struct file *file_p);
26  IFX_int32_t ifx_mps_close (struct inode *inode, struct file *file_p);
27 -IFX_int32_t ifx_mps_ioctl (struct inode *inode, struct file *file_p,
28 +long ifx_mps_ioctl (struct file *file_p,
29                             IFX_uint32_t nCmd, IFX_ulong_t arg);
30  IFX_int32_t ifx_mps_read_mailbox (mps_devices type, mps_message * rw);
31  IFX_int32_t ifx_mps_write_mailbox (mps_devices type, mps_message * rw);
32 @@ -171,7 +171,7 @@ IFX_char_t voice_channel_int_name[NUM_VO
33  static struct file_operations ifx_mps_fops = {
34   owner:THIS_MODULE,
35   poll:ifx_mps_poll,
36 - ioctl:ifx_mps_ioctl,
37 + unlocked_ioctl:ifx_mps_ioctl,
38   open:ifx_mps_open,
39   release:ifx_mps_close
40  };
41 @@ -614,7 +614,7 @@ static IFX_uint32_t ifx_mps_poll (struct
42   * \return  -ENOIOCTLCMD Invalid command
43   * \ingroup API
44   */
45 -IFX_int32_t ifx_mps_ioctl (struct inode * inode, struct file * file_p,
46 +long ifx_mps_ioctl (struct file *file_p,
47                             IFX_uint32_t nCmd, IFX_ulong_t arg)
48  {
49     IFX_int32_t retvalue = -EINVAL;
50 @@ -629,17 +629,18 @@ IFX_int32_t ifx_mps_ioctl (struct inode 
51        'mps_devices' enum type, which in fact is [0..8]; So, if inode value is
52        [0..NUM_VOICE_CHANNEL+1], then we make sure that we are calling from
53        kernel space. */
54 -   if (((IFX_int32_t) inode >= 0) &&
55 -       ((IFX_int32_t) inode < NUM_VOICE_CHANNEL + 1))
56 +   if (((IFX_int32_t) file_p >= 0) &&
57 +       ((IFX_int32_t) file_p < NUM_VOICE_CHANNEL + 1))
58     {
59        from_kernel = 1;
60  
61        /* Get corresponding mailbox device structure */
62        if ((pMBDev =
63 -           ifx_mps_get_device ((mps_devices) ((IFX_int32_t) inode))) == 0)
64 +           ifx_mps_get_device ((mps_devices) ((IFX_int32_t) file_p))) == 0)
65        {
66           return (-EINVAL);
67        }
68 +      file_p = NULL;
69     }
70     else
71     {
72 --- a/src/drv_vmmc_ioctl.c
73 +++ b/src/drv_vmmc_ioctl.c
74 @@ -427,18 +427,18 @@ IFX_int32_t VMMC_Dev_Spec_Ioctl (IFX_TAP
75           /* MPS driver will do the USR2KERN so just pass on the pointer. */
76           dwnld_struct.data = (IFX_void_t *)IoInit.pPRAMfw;
77  
78 -         ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL,
79 +         ret = ifx_mps_ioctl((IFX_void_t *)command,
80                               FIO_MPS_DOWNLOAD, (IFX_uint32_t) &dwnld_struct);
81           break;
82        }
83        case FIO_DEV_RESET:
84        {
85 -         ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL, FIO_MPS_RESET, 0);
86 +         ret = ifx_mps_ioctl((IFX_void_t *)command, FIO_MPS_RESET, 0);
87           break;
88        }
89        case FIO_DEV_RESTART:
90        {
91 -         ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL, FIO_MPS_RESTART, 0);
92 +         ret = ifx_mps_ioctl((IFX_void_t *)command, FIO_MPS_RESTART, 0);
93           break;
94        }
95        case FIO_LASTERR:
96 --- a/src/mps/drv_mps_vmmc.h
97 +++ b/src/mps/drv_mps_vmmc.h
98 @@ -279,7 +279,7 @@ typedef struct
99  #include <linux/fs.h>
100  IFX_int32_t ifx_mps_open (struct inode *inode, struct file *file_p);
101  IFX_int32_t ifx_mps_close (struct inode *inode, struct file *filp);
102 -IFX_int32_t ifx_mps_ioctl (struct inode *inode, struct file *file_p,
103 +long ifx_mps_ioctl (struct file *filp,
104                             IFX_uint32_t nCmd, unsigned long arg);
105  IFX_int32_t ifx_mps_register_data_callback (mps_devices type, IFX_uint32_t dir,
106                                              IFX_void_t (*callback) (mps_devices