[package] iwinfo: implement proper hardware detection for ar23xx SoC devices like...
[openwrt.git] / package / ltq-vmmc / 200-kernel-37.patch
1 --- a/src/drv_vmmc_init.c
2 +++ b/src/drv_vmmc_init.c
3 @@ -784,7 +784,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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
107 --- a/src/drv_vmmc_linux.c
108 +++ b/src/drv_vmmc_linux.c
109 @@ -32,7 +32,11 @@
110 #ifdef LINUX_2_6
111 #include <linux/version.h>
112 #ifndef UTS_RELEASE
113 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
114 +#include <linux/utsrelease.h>
115 +#else
116 #include <generated/utsrelease.h>
117 +#endif
118 #endif /* UTC_RELEASE */
119 #undef CONFIG_DEVFS_FS
120 #endif /* LINUX_2_6 */
121 --- a/src/mps/drv_mps_vmmc_common.c
122 +++ b/src/mps/drv_mps_vmmc_common.c
123 @@ -22,7 +22,11 @@
124 #undef USE_PLAIN_VOICE_FIRMWARE
125 #undef PRINT_ON_ERR_INTERRUPT
126 #undef FAIL_ON_ERR_INTERRUPT
127 -#include <generated/autoconf.h>
128 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
129 +#include <linux/utsrelease.h>
130 +#else
131 +#include <generated/utsrelease.h>
132 +#endif
133 #include <linux/interrupt.h>
134 #include <linux/delay.h>
135
136 @@ -47,8 +51,19 @@
137 # define ifx_gptu_timer_free lq_free_timer
138
139
140 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
141 # define bsp_mask_and_ack_irq ltq_mask_and_ack_irq
142 #else
143 +extern void ltq_mask_and_ack_irq(struct irq_data *d);
144 +static void inline bsp_mask_and_ack_irq(int x)
145 +{
146 + struct irq_data d;
147 + d.irq = x;
148 + ltq_mask_and_ack_irq(&d);
149 +}
150 +#endif
151 +
152 +#else
153 # include <asm/ifx/ifx_regs.h>
154 # include <asm/ifx/ifx_gptu.h>
155 #endif
156 @@ -107,7 +122,9 @@
157 extern mps_mbx_dev *ifx_mps_get_device (mps_devices type);
158
159 #ifdef LINUX_2_6
160 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
161 extern IFX_void_t bsp_mask_and_ack_irq (IFX_uint32_t irq_nr);
162 +#endif
163
164 #else /* */
165 extern IFX_void_t mask_and_ack_danube_irq (IFX_uint32_t irq_nr);
166 --- a/src/mps/drv_mps_vmmc_danube.c
167 +++ b/src/mps/drv_mps_vmmc_danube.c
168 @@ -16,11 +16,16 @@
169 /* ============================= */
170 /* Includes */
171 /* ============================= */
172 +#include "linux/version.h"
173 #include "drv_config.h"
174
175 #ifdef SYSTEM_DANUBE /* defined in drv_mps_vmmc_config.h */
176
177 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
178 +#include <linux/autoconf.h>
179 +#else
180 #include <generated/autoconf.h>
181 +#endif
182
183 /* lib_ifxos headers */
184 #include "ifx_types.h"
185 @@ -39,6 +44,7 @@
186 # include <linux/dma-mapping.h>
187
188
189 +#define LQ_RCU_BASE_ADDR (KSEG1 + LTQ_RCU_BASE_ADDR)
190 # define LQ_RCU_RST ((u32 *)(LQ_RCU_BASE_ADDR + 0x0010))
191 #define IFX_RCU_RST_REQ_CPU1 (1 << 3)
192 # define IFX_RCU_RST_REQ LQ_RCU_RST
This page took 0.049197 seconds and 5 git commands to generate.