1 /*
2  *  (C) 2004 Margit Schubert-While <margitsw@t-online.de>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License
7  *
8  *  This program is distributed in the hope that it will be useful,
9  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *  GNU General Public License for more details.
12  *
13  *  You should have received a copy of the GNU General Public License
14  *  along with this program; if not, write to the Free Software
15  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16  *
17  */
18 
19 /*
20  *	Compatibility header file to aid support of different kernel versions
21  */
22 
23 #ifndef _PRISM_COMPAT_H
24 #define _PRISM_COMPAT_H
25 
26 #include <linux/firmware.h>
27 #include <linux/config.h>
28 #include <linux/tqueue.h>
29 #include <linux/version.h>
30 #include <linux/compiler.h>
31 #include <linux/netdevice.h>
32 #include <asm/uaccess.h>
33 
34 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,25)
35 #define module_param(x, y, z)	MODULE_PARM(x, "i")
36 #else
37 #include <linux/moduleparam.h>
38 #endif
39 
40 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
41 #define free_netdev(x)		kfree(x)
42 #define pci_name(x)		x->slot_name
43 #define irqreturn_t		void
44 #define IRQ_HANDLED
45 #define IRQ_NONE
46 #else
47 #include <linux/interrupt.h>
48 #endif
49 
50 #define work_struct		tq_struct
51 #define INIT_WORK		INIT_TQUEUE
52 #define schedule_work		schedule_task
53 
54 #ifndef __iomem
55 #define __iomem
56 #endif
57 
58 #if !defined(HAVE_NETDEV_PRIV)
59 #define netdev_priv(x)		(x)->priv
60 #endif
61 
62 #if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
63 #error Firmware Loading is not configured in the kernel !
64 #endif
65 
66 #define prism54_synchronize_irq(irq) synchronize_irq()
67 
68 #define DEFINE_WAIT(y)			DECLARE_WAITQUEUE(y, current)
69 #define prepare_to_wait(x, y, z)	set_current_state(z); \
70 					add_wait_queue(x, y)
71 #define finish_wait(x, y)		remove_wait_queue(x, y); \
72 					set_current_state(TASK_RUNNING)
73 
74 #define PRISM_FW_PDEV		pci_name(priv->pdev)
75 
76 #endif				/* _PRISM_COMPAT_H */
77