3 @@ -228,7 +228,7 @@ drv_vmmc_CFLAGS += -fno-common
4 drv_vmmc_OBJS = "$(subst .c,.o, $(drv_vmmc_SOURCES) $(nodist_drv_vmmc_SOURCES))"
6 drv_vmmc.ko: $(drv_vmmc_SOURCES) $(EXTRA_DIST)
7 - @echo -e "Making Linux 2.6.x kernel object"
8 + @echo "Making Linux 2.6.x kernel object"
9 @for f in $(drv_vmmc_SOURCES) $(nodist_drv_vmmc_SOURCES) ; do \
10 if test ! -e $(PWD)/$$f; then \
12 @@ -236,10 +236,10 @@ drv_vmmc.ko: $(drv_vmmc_SOURCES) $(EXTRA
13 ln -s @abs_srcdir@/$$f $(PWD)/$$f; \
16 - @echo -e "# drv_vmmc: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
17 - @echo -e "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
18 - @echo -e "$(subst .ko,,$@)-y := $(drv_vmmc_OBJS)" >> $(PWD)/Kbuild
19 - @echo -e "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_vmmc_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
20 + @echo "# drv_vmmc: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
21 + @echo "obj-m := $(subst .ko,.o,$@)" >> $(PWD)/Kbuild
22 + @echo "$(subst .ko,,$@)-y := $(drv_vmmc_OBJS)" >> $(PWD)/Kbuild
23 + @echo "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(CFLAGS) $(drv_vmmc_CFLAGS) $(INCLUDES)" >> $(PWD)/Kbuild
24 $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
27 --- a/src/drv_vmmc_linux.c
28 +++ b/src/drv_vmmc_linux.c
30 #include <linux/proc_fs.h>
31 #include <linux/wait.h>
32 #include <linux/vmalloc.h>
33 +#include <linux/sched.h>
36 #include <linux/version.h>
38 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
39 +#include <linux/autoconf.h>
40 #include <linux/utsrelease.h>
42 +#include <generated/autoconf.h>
43 +#include <generated/utsrelease.h>
45 #endif /* UTC_RELEASE */
46 #undef CONFIG_DEVFS_FS
47 #endif /* LINUX_2_6 */
48 --- a/src/mps/drv_mps_vmmc_linux.c
49 +++ b/src/mps/drv_mps_vmmc_linux.c
51 #include "drv_config.h"
53 #include "drv_mps_version.h"
54 +#include <linux/version.h>
56 #ifdef CONFIG_DEBUG_MINI_BOOT
57 #define IKOS_MINI_BOOT
59 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
60 #include <linux/autoconf.h>
62 +#include <linux/utsrelease.h>
65 +#include <generated/autoconf.h>
67 +#include <generated/utsrelease.h>
70 #include <linux/module.h>
71 #include <linux/init.h>
72 #include <linux/poll.h>
74 #include <linux/delay.h>
75 #include <linux/interrupt.h>
78 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)
79 #include <linux/utsrelease.h>
81 +#include <generated/utsrelease.h>
83 +#endif /* UTC_RELEASE */
85 #include <linux/uts.h>
86 #include <linux/moduleparam.h>
87 @@ -94,8 +111,13 @@ IFX_int32_t ifx_mps_get_status_proc (IFX
89 IFX_int32_t ifx_mps_open (struct inode *inode, struct file *file_p);
90 IFX_int32_t ifx_mps_close (struct inode *inode, struct file *file_p);
91 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
92 IFX_int32_t ifx_mps_ioctl (struct inode *inode, struct file *file_p,
93 IFX_uint32_t nCmd, IFX_ulong_t arg);
95 +long ifx_mps_ioctl (struct file *file_p,
96 + IFX_uint32_t nCmd, IFX_ulong_t arg);
98 IFX_int32_t ifx_mps_read_mailbox (mps_devices type, mps_message * rw);
99 IFX_int32_t ifx_mps_write_mailbox (mps_devices type, mps_message * rw);
100 IFX_int32_t ifx_mps_register_data_callback (mps_devices type, IFX_uint32_t dir,
101 @@ -155,7 +177,11 @@ IFX_char_t voice_channel_int_name[NUM_VO
102 static struct file_operations ifx_mps_fops = {
105 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
108 + unlocked_ioctl:ifx_mps_ioctl,
111 release:ifx_mps_close
113 @@ -598,8 +624,13 @@ static IFX_uint32_t ifx_mps_poll (struct
114 * \return -ENOIOCTLCMD Invalid command
117 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
118 IFX_int32_t ifx_mps_ioctl (struct inode * inode, struct file * file_p,
119 IFX_uint32_t nCmd, IFX_ulong_t arg)
121 +long ifx_mps_ioctl (struct file *file_p,
122 + IFX_uint32_t nCmd, IFX_ulong_t arg)
125 IFX_int32_t retvalue = -EINVAL;
126 mps_message rw_struct;
127 @@ -613,17 +644,30 @@ IFX_int32_t ifx_mps_ioctl (struct inode
128 'mps_devices' enum type, which in fact is [0..8]; So, if inode value is
129 [0..NUM_VOICE_CHANNEL+1], then we make sure that we are calling from
131 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
132 if (((IFX_int32_t) inode >= 0) &&
133 ((IFX_int32_t) inode < NUM_VOICE_CHANNEL + 1))
135 + if (((IFX_int32_t) file_p >= 0) &&
136 + ((IFX_int32_t) file_p < NUM_VOICE_CHANNEL + 1))
141 /* Get corresponding mailbox device structure */
143 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
144 ifx_mps_get_device ((mps_devices) ((IFX_int32_t) inode))) == 0)
146 + ifx_mps_get_device ((mps_devices) ((IFX_int32_t) file_p))) == 0)
151 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
158 --- a/src/mps/drv_mps_vmmc_common.c
159 +++ b/src/mps/drv_mps_vmmc_common.c
161 #undef USE_PLAIN_VOICE_FIRMWARE
162 #undef PRINT_ON_ERR_INTERRUPT
163 #undef FAIL_ON_ERR_INTERRUPT
164 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
165 #include <linux/autoconf.h>
167 +#include <generated/autoconf.h>
169 #include <linux/interrupt.h>
170 #include <linux/delay.h>
172 @@ -92,7 +96,9 @@ extern IFX_uint32_t danube_get_cpu_ver (
173 extern mps_mbx_dev *ifx_mps_get_device (mps_devices type);
176 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
177 extern IFX_void_t bsp_mask_and_ack_irq (IFX_uint32_t irq_nr);
181 extern IFX_void_t mask_and_ack_danube_irq (IFX_uint32_t irq_nr);
182 --- a/src/mps/drv_mps_vmmc_danube.c
183 +++ b/src/mps/drv_mps_vmmc_danube.c
186 #ifdef SYSTEM_DANUBE /* defined in drv_mps_vmmc_config.h */
188 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
189 #include <linux/autoconf.h>
191 +#include <generated/autoconf.h>
194 /* lib_ifxos headers */
195 #include "ifx_types.h"
198 @@ -112,7 +112,7 @@ dnl Set kernel build path
199 AC_ARG_ENABLE(kernelbuild,
200 AS_HELP_STRING(--enable-kernelbuild=x,Set the target kernel build path),
202 - if test -r $enableval/include/linux/autoconf.h; then
203 + if test -e $enableval/include/linux/autoconf.h -o -e $enableval/include/generated/autoconf.h; then
204 AC_SUBST([KERNEL_BUILD_PATH],[$enableval])
206 AC_MSG_ERROR([The kernel build directory is not valid or not configured!])
207 --- a/src/drv_vmmc_bbd.c
208 +++ b/src/drv_vmmc_bbd.c
209 @@ -1072,7 +1072,11 @@ static IFX_int32_t vmmc_BBD_DownloadChCr
210 IFX_uint8_t padBytes = 0;
212 IFX_uint16_t cram_offset, cram_crc,
213 - pCmd [MAX_CMD_WORD] = {0};
214 + pCmd [MAX_CMD_WORD]
215 +#if defined (__GNUC__) || defined (__GNUG__)
216 + __attribute__ ((aligned(4)))
221 cpb2w (&cram_offset, &bbd_cram->pData[0], sizeof (IFX_uint16_t));
222 --- a/src/drv_vmmc_init.c
223 +++ b/src/drv_vmmc_init.c
224 @@ -776,8 +776,13 @@ IFX_int32_t VMMC_TAPI_LL_FW_Start(IFX_TA
225 dwld.fwDwld.length = IoInit.pram_size;
227 /* download firmware */
228 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
229 ret = ifx_mps_ioctl((IFX_void_t *) command, IFX_NULL, FIO_MPS_DOWNLOAD,
230 (IFX_uint32_t) &dwld.fwDwld);
232 + ret = ifx_mps_ioctl((IFX_void_t *) command, FIO_MPS_DOWNLOAD,
233 + (IFX_uint32_t) &dwld.fwDwld);
237 if (VMMC_SUCCESS(ret))
238 --- a/src/drv_vmmc_ioctl.c
239 +++ b/src/drv_vmmc_ioctl.c
240 @@ -426,18 +426,31 @@ IFX_int32_t VMMC_Dev_Spec_Ioctl (IFX_TAP
241 /* MPS driver will do the USR2KERN so just pass on the pointer. */
242 dwnld_struct.data = (IFX_void_t *)IoInit.pPRAMfw;
244 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
245 ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL,
246 FIO_MPS_DOWNLOAD, (IFX_uint32_t) &dwnld_struct);
248 + ret = ifx_mps_ioctl((IFX_void_t *)command,
249 + FIO_MPS_DOWNLOAD, (IFX_uint32_t) &dwnld_struct);
255 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
256 ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL, FIO_MPS_RESET, 0);
258 + ret = ifx_mps_ioctl((IFX_void_t *)command, FIO_MPS_RESET, 0);
262 case FIO_DEV_RESTART:
264 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
265 ret = ifx_mps_ioctl((IFX_void_t *)command, IFX_NULL, FIO_MPS_RESTART, 0);
267 + ret = ifx_mps_ioctl((IFX_void_t *)command, FIO_MPS_RESTART, 0);
272 --- a/src/mps/drv_mps_vmmc.h
273 +++ b/src/mps/drv_mps_vmmc.h
274 @@ -279,8 +279,13 @@ typedef struct
275 #include <linux/fs.h>
276 IFX_int32_t ifx_mps_open (struct inode *inode, struct file *file_p);
277 IFX_int32_t ifx_mps_close (struct inode *inode, struct file *filp);
278 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
279 IFX_int32_t ifx_mps_ioctl (struct inode *inode, struct file *file_p,
280 IFX_uint32_t nCmd, unsigned long arg);
282 +long ifx_mps_ioctl (struct file *filp,
283 + IFX_uint32_t nCmd, unsigned long arg);
285 IFX_int32_t ifx_mps_register_data_callback (mps_devices type, IFX_uint32_t dir,
286 IFX_void_t (*callback) (mps_devices