[PATCH 5/14 linux-2.6.7-rc1] prism54: new prism54 kernel compatibility

From: Luis R. Rodriguez
Date: Mon May 24 2004 - 03:47:36 EST



2004-03-20 Margit Schubert-While <margitsw@xxxxxxxxxxx>

* isl_38xx.[ch], isl_ioctl.c, islpci_dev.[ch], islpci_eth.c
islpci_hotplug.c, islpci_mgt.[ch], oid_mgt.c: Adopt new
prism54 kernel compatibility.

* prismcompat.h, prismcompat24.h: New compatibility work


--
GnuPG Key fingerprint = 113F B290 C6D2 0251 4D84 A34A 6ADD 4937 E20A 525E
2004-03-20 Margit Schubert-While <margitsw@xxxxxxxxxxx>

* isl_38xx.[ch], isl_ioctl.c, islpci_dev.[ch], islpci_eth.c
islpci_hotplug.c, islpci_mgt.[ch], oid_mgt.c: Adopt new
prism54 kernel compatibility.

* prismcompat.h, prismcompat24.h: New compatibility work

Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_38xx.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_38xx.c 18 Mar 2004 05:25:24 -0000 1.25
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_38xx.c 20 Mar 2004 16:58:36 -0000 1.26
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.c,v 1.22 2004/02/28 03:06:07 mcgrof Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.c,v 1.26 2004/03/20 16:58:36 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003-2004 Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxxxx>_
@@ -25,17 +25,11 @@
#include <linux/types.h>
#include <linux/delay.h>

-#include "isl_38xx.h"
-#include <linux/firmware.h>
-
#include <asm/uaccess.h>
#include <asm/io.h>

-#include <linux/config.h>
-#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
-#error No Firmware Loading configured in the kernel !
-#endif
-
+#include "prismcompat.h"
+#include "isl_38xx.h"
#include "islpci_dev.h"
#include "islpci_mgt.h"

Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_38xx.h
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_38xx.h 18 Mar 2004 05:25:24 -0000 1.24
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_38xx.h 20 Mar 2004 16:58:36 -0000 1.25
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.h,v 1.22 2004/02/28 03:06:07 mcgrof Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.h,v 1.25 2004/03/20 16:58:36 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
*
@@ -22,14 +22,6 @@

#include <linux/version.h>
#include <asm/io.h>
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,75))
-#include <linux/device.h>
-# define _REQ_FW_DEV_T struct device *
-#else
-# define _REQ_FW_DEV_T char *
-#endif
-
#include <asm/byteorder.h>

#define ISL38XX_CB_RX_QSIZE 8
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_ioctl.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/isl_ioctl.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -r1.148 -r1.149
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_ioctl.c 19 Mar 2004 23:03:58 -0000 1.148
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/isl_ioctl.c 20 Mar 2004 16:58:36 -0000 1.149
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_ioctl.c,v 1.148 2004/03/19 23:03:58 ajfa Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_ioctl.c,v 1.149 2004/03/20 16:58:36 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
* (C) 2003,2004 Aurelien Alleaume <slts@xxxxxxx>
@@ -25,10 +25,10 @@
#include <linux/kernel.h>
#include <linux/if_arp.h>
#include <linux/pci.h>
-#include <linux/moduleparam.h>

#include <asm/uaccess.h>

+#include "prismcompat.h"
#include "isl_ioctl.h"
#include "islpci_mgt.h"
#include "isl_oid.h" /* additional types and defs for isl38xx fw */
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_dev.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_dev.c 19 Mar 2004 20:54:33 -0000 1.72
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_dev.c 20 Mar 2004 16:58:36 -0000 1.73
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.c,v 1.72 2004/03/19 20:54:33 ajfa Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.c,v 1.73 2004/03/20 16:58:36 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003 Herbert Valerio Riedel <hvr@xxxxxxx>
@@ -30,6 +30,7 @@

#include <asm/io.h>

+#include "prismcompat.h"
#include "isl_38xx.h"
#include "isl_ioctl.h"
#include "islpci_dev.h"
@@ -37,12 +38,6 @@
#include "islpci_eth.h"
#include "oid_mgt.h"

-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-#define prism54_synchronize_irq(irq) synchronize_irq()
-#else
-#define prism54_synchronize_irq(irq) synchronize_irq(irq)
-#endif
-
#define ISL3877_IMAGE_FILE "isl3877"
#define ISL3890_IMAGE_FILE "isl3890"

@@ -325,11 +320,7 @@
printk(KERN_DEBUG "%s: uploading firmware...\n", priv->ndev->name);

rc = isl38xx_upload_firmware(priv->firmware,
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,75))
- &priv->pdev->dev,
-#else
- pci_name(priv->pdev),
-#endif
+ PRISM_FW_PDEV,
priv->device_base,
priv->device_host_address);
if (rc) {
@@ -357,15 +348,7 @@
int result = -ETIME;
int count;

-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- /* This is 2.6 specific, nicer, shorter, but not in 2.4 yet */
- DEFINE_WAIT(wait);
- prepare_to_wait(&priv->reset_done, &wait, TASK_UNINTERRUPTIBLE);
-#else
- DECLARE_WAITQUEUE(wait, current);
- set_current_state(TASK_UNINTERRUPTIBLE);
- add_wait_queue(&priv->reset_done, &wait);
-#endif
+ PRISM_DEFWAITQ(priv->reset_done, wait);

/* now the last step is to reset the interface */
isl38xx_interface_reset(priv->device_base, priv->device_host_address);
@@ -390,13 +373,7 @@

}

-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- /* 2.6 specific too */
- finish_wait(&priv->reset_done, &wait);
-#else
- remove_wait_queue(&priv->reset_done, &wait);
- set_current_state(TASK_RUNNING);
-#endif
+ PRISM_ENDWAITQ(priv->reset_done, wait);

if(result)
return result;
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_dev.h
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_dev.h 19 Mar 2004 20:54:33 -0000 1.58
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_dev.h 20 Mar 2004 16:58:36 -0000 1.59
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.h,v 1.58 2004/03/19 20:54:33 ajfa Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.h,v 1.59 2004/03/20 16:58:36 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003 Herbert Valerio Riedel <hvr@xxxxxxx>
@@ -29,20 +29,6 @@
#include <net/iw_handler.h>
#include <linux/list.h>

-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
-# include <linux/workqueue.h>
-#else
-# include <linux/tqueue.h>
-# define work_struct tq_struct
-# define INIT_WORK INIT_TQUEUE
-# define schedule_work schedule_task
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
-#define free_netdev(x) kfree(x)
-#define pci_name(x) x->slot_name
-#endif
-
#include "isl_38xx.h"
#include "isl_oid.h"
#include "islpci_mgt.h"
@@ -210,12 +196,6 @@

#define ISLPCI_TX_TIMEOUT (2*HZ)

-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,75))
-# define irqreturn_t void
-# define IRQ_HANDLED
-# define IRQ_NONE
-#endif
-
irqreturn_t islpci_interrupt(int, void *, struct pt_regs *);

int prism54_post_setup(islpci_private *, int);
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_eth.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/islpci_eth.c,v
retrieving revision 1.33
retrieving revision 1.35
diff -u -r1.33 -r1.35
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_eth.c 19 Mar 2004 23:03:58 -0000 1.33
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_eth.c 20 Mar 2004 16:58:36 -0000 1.35
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_eth.c,v 1.33 2004/03/19 23:03:58 ajfa Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_eth.c,v 1.35 2004/03/20 16:58:36 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2004 Aurelien Alleaume <slts@xxxxxxx>
@@ -26,6 +26,7 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>

+#include "prismcompat.h"
#include "isl_38xx.h"
#include "islpci_eth.h"
#include "islpci_mgt.h"
@@ -261,9 +262,9 @@
if (priv->ndev->type == ARPHRD_IEEE80211_PRISM) {
struct avs_80211_1_header *avs;
/* extract the relevant data from the header */
- u32 clock = hdr->clock;
+ u32 clock = le32_to_cpu(hdr->clock);
u8 rate = hdr->rate;
- u16 freq = be16_to_cpu(hdr->freq);
+ u16 freq = le16_to_cpu(hdr->freq);
u8 rssi = hdr->rssi;

skb_pull(*skb, sizeof (struct rfmon_header));
@@ -286,21 +287,21 @@
(struct avs_80211_1_header *) skb_push(*skb,
sizeof (struct
avs_80211_1_header));
-
- avs->version = htonl(P80211CAPTURE_VERSION);
- avs->length = htonl(sizeof (struct avs_80211_1_header));
- avs->mactime = __cpu_to_be64(clock);
- avs->hosttime = __cpu_to_be64(jiffies);
- avs->phytype = htonl(6); /*OFDM: 6 for (g), 8 for (a) */
- avs->channel = htonl(channel_of_freq(freq));
- avs->datarate = htonl(rate * 5);
- avs->antenna = htonl(0); /*unknown */
- avs->priority = htonl(0); /*unknown */
- avs->ssi_type = htonl(2); /*2: dBm, 3: raw RSSI */
- avs->ssi_signal = htonl(rssi);
- avs->ssi_noise = htonl(priv->local_iwstatistics.qual.noise); /*better than 'undefined', I assume */
- avs->preamble = htonl(0); /*unknown */
- avs->encoding = htonl(0); /*unknown */
+
+ avs->version = cpu_to_be32(P80211CAPTURE_VERSION);
+ avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header));
+ avs->mactime = cpu_to_be64(le64_to_cpu(clock));
+ avs->hosttime = cpu_to_be64(jiffies);
+ avs->phytype = cpu_to_be32(6); /*OFDM: 6 for (g), 8 for (a) */
+ avs->channel = cpu_to_be32(channel_of_freq(freq));
+ avs->datarate = cpu_to_be32(rate * 5);
+ avs->antenna = cpu_to_be32(0); /*unknown */
+ avs->priority = cpu_to_be32(0); /*unknown */
+ avs->ssi_type = cpu_to_be32(3); /*2: dBm, 3: raw RSSI */
+ avs->ssi_signal = cpu_to_be32(rssi & 0x7f);
+ avs->ssi_noise = cpu_to_be32(priv->local_iwstatistics.qual.noise); /*better than 'undefined', I assume */
+ avs->preamble = cpu_to_be32(0); /*unknown */
+ avs->encoding = cpu_to_be32(0); /*unknown */
} else
skb_pull(*skb, sizeof (struct rfmon_header));

Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_hotplug.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/islpci_hotplug.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_hotplug.c 18 Mar 2004 05:25:24 -0000 1.58
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_hotplug.c 20 Mar 2004 16:58:36 -0000 1.59
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_hotplug.c,v 1.56 2004/02/26 23:33:02 mcgrof Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_hotplug.c,v 1.59 2004/03/20 16:58:36 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003 Herbert Valerio Riedel <hvr@xxxxxxx>
@@ -24,6 +24,7 @@
#include <linux/delay.h>
#include <linux/init.h> /* For __init, __exit */

+#include "prismcompat.h"
#include "islpci_dev.h"
#include "islpci_mgt.h" /* for pc_debug */
#include "isl_oid.h"
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_mgt.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_mgt.c 18 Mar 2004 05:25:24 -0000 1.42
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_mgt.c 20 Mar 2004 16:58:37 -0000 1.43
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.c,v 1.40 2004/02/01 10:57:23 mcgrof Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.c,v 1.43 2004/03/20 16:58:37 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright 2004 Jens Maurer <Jens.Maurer@xxxxxxx>
@@ -22,12 +22,12 @@
#include <linux/netdevice.h>
#include <linux/module.h>
#include <linux/pci.h>
-#include <linux/moduleparam.h>

#include <asm/io.h>
#include <asm/system.h>
#include <linux/if_arp.h>

+#include "prismcompat.h"
#include "isl_38xx.h"
#include "islpci_mgt.h"
#include "isl_oid.h" /* additional types and defs for isl38xx fw */
@@ -456,21 +456,11 @@
const long wait_cycle_jiffies = (ISL38XX_WAIT_CYCLE * 10 * HZ) / 1000;
long timeout_left = ISL38XX_MAX_WAIT_CYCLES * wait_cycle_jiffies;
int err;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- DEFINE_WAIT(wait);
-#else
- DECLARE_WAITQUEUE(wait, current);
-#endif

if (down_interruptible(&priv->mgmt_sem))
return -ERESTARTSYS;

-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- prepare_to_wait(&priv->mgmt_wqueue, &wait, TASK_UNINTERRUPTIBLE);
-#else
- set_current_state(TASK_UNINTERRUPTIBLE);
- add_wait_queue(&priv->mgmt_wqueue, &wait);
-#endif
+ PRISM_DEFWAITQ(priv->mgmt_wqueue, wait);
err = islpci_mgt_transmit(ndev, operation, oid, senddata, sendlen);
if(err)
goto out;
@@ -499,12 +489,7 @@

/* TODO: we should reset the device here */
out:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- finish_wait(&priv->mgmt_wqueue, &wait);
-#else
- remove_wait_queue(&priv->mgmt_wqueue, &wait);
- set_current_state(TASK_RUNNING);
-#endif
+ PRISM_ENDWAITQ(priv->mgmt_wqueue, wait);
up(&priv->mgmt_sem);
return err;
}
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_mgt.h
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_mgt.h 18 Mar 2004 05:25:24 -0000 1.24
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/islpci_mgt.h 20 Mar 2004 16:58:37 -0000 1.25
@@ -1,4 +1,4 @@
-/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.h,v 1.22 2004/01/30 16:24:00 ajfa Exp $
+/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.h,v 1.25 2004/03/20 16:58:37 mcgrof Exp $
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003 Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxxxx>
@@ -24,15 +24,6 @@
#include <linux/wireless.h>
#include <linux/skbuff.h>

-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
-# include <linux/workqueue.h>
-#else
-# include <linux/tqueue.h>
-# define work_struct tq_struct
-# define INIT_WORK INIT_TQUEUE
-# define schedule_work schedule_task
-#endif
-
/*
* Function definitions
*/
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/oid_mgt.c
===================================================================
RCS file: /var/lib/cvs/prism54-ng/ksrc/oid_mgt.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- linux-2.6.7-rc1/drivers/net/wireless/prism54/oid_mgt.c 19 Mar 2004 23:03:58 -0000 1.11
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/oid_mgt.c 20 Mar 2004 16:58:37 -0000 1.12
@@ -16,6 +16,7 @@
*
*/

+#include "prismcompat.h"
#include "islpci_dev.h"
#include "islpci_mgt.h"
#include "isl_oid.h"
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/prismcompat.h
===================================================================
RCS file: ksrc/prismcompat.h
diff -N ksrc/prismcompat.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/prismcompat.h 20 Mar 2004 18:23:28 -0000 1.1
@@ -0,0 +1,47 @@
+/*
+ * (C) 2004 Margit Schubert-While <margitsw@xxxxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/*
+ * Compatibility header file to aid support of different kernel versions
+ */
+
+#ifndef _PRISM_COMPAT_H
+#define _PRISM_COMPAT_H
+
+#include <linux/device.h>
+#include <linux/firmware.h>
+#include <linux/config.h>
+#include <linux/moduleparam.h>
+#include <linux/workqueue.h>
+
+#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
+#error Firmware Loading is not configured in the kernel !
+#endif
+
+#define prism54_synchronize_irq(irq) synchronize_irq(irq)
+
+#define PRISM_DEFWAITQ(x, y) DEFINE_WAIT(y); \
+ prepare_to_wait(&(x), &(y), TASK_UNINTERRUPTIBLE)
+
+#define PRISM_ENDWAITQ(x, y) finish_wait(&(x), &(y))
+
+#define _REQ_FW_DEV_T struct device *
+
+#define PRISM_FW_PDEV &priv->pdev->dev
+
+#endif /* _PRISM_COMPAT_H */
Index: linux-2.6.7-rc1/drivers/net/wireless/prism54/prismcompat24.h
===================================================================
RCS file: ksrc/prismcompat24.h
diff -N ksrc/prismcompat24.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ linux-2.6.7-rc1/drivers/net/wireless/prism54/prismcompat24.h 20 Mar 2004 18:23:28 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * (C) 2004 Margit Schubert-While <margitsw@xxxxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/*
+ * Compatibility header file to aid support of different kernel versions
+ */
+
+#ifndef _PRISM_COMPAT_H
+#define _PRISM_COMPAT_H
+
+#include <linux/firmware.h>
+#include <linux/config.h>
+#include <linux/tqueue.h>
+
+#define work_struct tq_struct
+#define INIT_WORK INIT_TQUEUE
+#define schedule_work schedule_task
+
+#define irqreturn_t void
+#define IRQ_HANDLED
+#define IRQ_NONE
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
+#define free_netdev(x) kfree(x)
+#define pci_name(x) x->slot_name
+#endif
+
+#define module_param(x, y, z) MODULE_PARM(x, "i")
+
+#define netdev_priv(x) x->priv
+
+#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
+#error Firmware Loading is not configured in the kernel !
+#endif
+
+#define prism54_synchronize_irq(irq) synchronize_irq()
+
+#define PRISM_DEFWAITQ(x, y) DECLARE_WAITQUEUE(y, current); \
+ set_current_state(TASK_UNINTERRUPTIBLE); \
+ add_wait_queue(&(x), &(y))
+
+#define PRISM_ENDWAITQ(x, y) remove_wait_queue(&(x), &(y)); \
+ set_current_state(TASK_RUNNING)
+
+#define _REQ_FW_DEV_T char *
+
+#define PRISM_FW_PDEV pci_name(priv->pdev)
+
+#endif /* _PRISM_COMPAT_H */

Attachment: pgp00000.pgp
Description: PGP signature