diff -Naur linux-wlan-0.3.4/CHANGES linux-wlan-0.3.5-pre1/CHANGES
--- linux-wlan-0.3.4/CHANGES	1999-11-06 02:21:04.000000000 +0000
+++ linux-wlan-0.3.5-pre1/CHANGES	2004-08-04 23:08:06.000000000 +0100
@@ -1,3 +1,11 @@
+Version 0.3.5-pre1
+-- mods to build with stock redhat kernel source install
+-- support for building under Linux 2.4 with kernel PCMCIA
+-- minor build cleanups (unused functions #def'd out)
+-- set ownership of modules to root on installation
+-- add build targets for scripts directory
+-- fix typos in scripts/wlan and scripts/rc.wlan
+
 Version 0.3.4
 -- Removed some cs specific messages
 -- Added auth and assoc commands to wlanctl/am930llc/am930mgr
diff -Naur linux-wlan-0.3.4/config.mk linux-wlan-0.3.5-pre1/config.mk
--- linux-wlan-0.3.4/config.mk	1999-11-06 02:21:58.000000000 +0000
+++ linux-wlan-0.3.5-pre1/config.mk	2004-08-04 22:41:51.000000000 +0100
@@ -1,7 +1,7 @@
 LINUX_SRC=/usr/src/linux
 PCMCIA_SRC=
-MODULES_DIR=/lib/modules/2.2.9
+MODULES_DIR=/lib/modules
 INST_EXEDIR=/sbin
 DESTDIR=
 MAKE_ISA=y
-MAKE_CS=n
+MAKE_CS=y
diff -Naur linux-wlan-0.3.4/driver/am930cs.c linux-wlan-0.3.5-pre1/driver/am930cs.c
--- linux-wlan-0.3.4/driver/am930cs.c	1999-11-06 02:21:06.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/am930cs.c	2004-06-23 19:53:18.000000000 +0100
@@ -35,13 +35,18 @@
 */
 
 #if defined(__LINUX_WLAN__)
+#include <linux/config.h>
+#include <linux/version.h>
 /* PCMCIA headers generated during PCMCIA package installation */
-#include <pcmcia/config.h>
+#ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
+#endif
+
+#include <wlan/version.h>
+#include <wlan/wlan_compat.h>
 
 /* Module related headers, non-module drivers should not include */
 #include <linux/module.h>
-#include <linux/version.h>
 
 /* Standard driver includes */
 #include <linux/kernel.h>
@@ -52,7 +57,11 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
 #include <linux/malloc.h>
+#else
+#include <linux/slab.h>
+#endif
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/kernel_stat.h>
@@ -83,8 +92,6 @@
 
 /*================================================================*/
 /* Local Includes */
-#include <wlan/version.h>
-#include <wlan/wlan_compat.h>
 #include "am930di.h"
 
 /*================================================================*/
diff -Naur linux-wlan-0.3.4/driver/am930di.c linux-wlan-0.3.5-pre1/driver/am930di.c
--- linux-wlan-0.3.4/driver/am930di.c	1999-11-06 02:21:06.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/am930di.c	2004-06-23 20:40:08.000000000 +0100
@@ -39,9 +39,15 @@
 /* The following prevents "kernel_version" from being set in this file. */
 #define __NO_VERSION__
 
+#include <linux/config.h>
+#include <linux/version.h>
+#include <wlan/version.h>
+#include <wlan/wlan_compat.h>
+
 /* PCMCIA headers generated during PCMCIA package installation */
-#include <pcmcia/config.h>
+#ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
+#endif
 
 /* Module related headers, non-module drivers should not include */
 #include <linux/version.h>
@@ -67,7 +73,11 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
 #include <linux/malloc.h>
+#else
+#include <linux/slab.h>
+#endif
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <asm/bitops.h>
@@ -84,8 +94,6 @@
 #endif
 
 /* Local Includes */
-#include <wlan/version.h>
-#include <wlan/wlan_compat.h>
 #include <wlan/p80211hdr.h>
 #include <wlan/p80211mgmt.h>
 #include "am930di.h"
@@ -93,7 +101,7 @@
 #include "am930mac.h"
 #include "am930hw.h"
 
-#if (LINUX_VERSION_CODE < VERSION(2,2,0))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0))
 #				define ioremap_nocache ioremap
 #endif
 
diff -Naur linux-wlan-0.3.4/driver/am930hw.c linux-wlan-0.3.5-pre1/driver/am930hw.c
--- linux-wlan-0.3.4/driver/am930hw.c	1999-11-06 02:21:06.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/am930hw.c	2004-06-23 21:17:07.000000000 +0100
@@ -35,6 +35,7 @@
 
 
 #include <linux/config.h>
+#include <linux/version.h>
 #include <wlan/wlan_compat.h>
 
 #if (WLAN_OS == WLAN_LINUX_KERNEL)
@@ -44,9 +45,10 @@
 
 /* PCMCIA headers generated during PCMCIA package installation */
 #ifdef WLAN_PCMCIA
-#include <pcmcia/config.h>
+#ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
 #endif
+#endif
 
 
 /* Module related headers, non-module drivers should not include */
@@ -74,7 +76,11 @@
 #include <linux/ptrace.h>
 #include <linux/interrupt.h>
 #include <linux/in.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
 #include <linux/malloc.h>
+#else
+#include <linux/slab.h>
+#endif
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/errno.h>
diff -Naur linux-wlan-0.3.4/driver/am930llc.c linux-wlan-0.3.5-pre1/driver/am930llc.c
--- linux-wlan-0.3.4/driver/am930llc.c	1999-11-06 02:21:07.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/am930llc.c	2004-08-02 12:06:56.000000000 +0100
@@ -34,6 +34,7 @@
 */
 
 #include <linux/config.h>
+#include <linux/version.h>
 #include <wlan/wlan_compat.h>
 
 /* The following prevents "kernel_version" from being set in this file. */
@@ -41,15 +42,16 @@
 
 /* PCMCIA headers generated during PCMCIA package installation */
 #ifdef WLAN_PCMCIA
-#include <pcmcia/config.h>
+#if __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
 #endif
+#endif
 
 /* Module related headers, non-module drivers should not include */
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
+#include <linux/wait.h>
 
 /* Ethernet and network includes */
 #include <linux/if_ether.h>
@@ -73,7 +75,11 @@
 #include <linux/ptrace.h>
 #include <linux/interrupt.h>
 #include <linux/in.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
 #include <linux/malloc.h>
+#else
+#include <linux/slab.h>
+#endif
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/errno.h>
@@ -192,9 +198,10 @@
 
 		/* the dev name field will point to the same memory used by the 
 			node_t field of the pcmcia di object */
-		#ifdef WLAN_PCMCIA
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,14)
+#ifdef WLAN_PCMCIA
 		llc->dev->name = ((dev_link_t*)(llc->mac->di))->dev->dev_name;
-		#else
+#else
 		llc->dev->name = kmalloc(WLAN_DEVNAME_LEN, GFP_KERNEL);
 		if ( llc->dev->name == NULL )
 		{
@@ -205,7 +212,8 @@
 			return NULL;
 		}
 		llc->dev->name[0] = '\0';
-		#endif
+#endif
+#endif
 
 		/* set the private data to point back at the llc */
 		V2P(llc->dev->priv)->llc = llc;
@@ -222,6 +230,13 @@
 		llc->dev->set_multicast_list	= am930llc_devset_multicast_list;
 		llc->dev->do_ioctl				= (do_ioctl_t)am930llc_devdo_ioctl;
 
+		/* initialise the cmdwq */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
+		llc->cmdwq = NULL; /* not strictly necessary */
+#else
+		init_waitqueue_head(&(llc->cmdwq));
+#endif
+
 		ether_setup( llc->dev );
 
 		if ( register_netdev(llc->dev) != 0 )
@@ -271,9 +286,12 @@
 
 	/* Assume the timer was set up to watch us while an ioctl's in */
 	/*  the wait queue.  Check for NULL and if not, wake it */
-	if ( llc->cmdwq != NULL ){
-		wake_up_interruptible(&(llc->cmdwq));
-	}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
+	if ( llc->cmdwq != NULL )
+#endif
+	  {
+	    wake_up_interruptible(&(llc->cmdwq));
+	  }
 
 	DBFEXIT;
 	return;
@@ -324,7 +342,9 @@
 	if ( llc->dev != NULL )
 	{
 		del_timer(&llc->timer);
+#if LINUX_VERSION_CODE < 0x2032B /* icky - 2.3.43? */
 		llc->dev->start = 0;
+#endif
 		unregister_netdev( llc->dev );
 		kfree(llc->dev);
 		llc->dev = NULL;
@@ -368,10 +388,13 @@
 {
 	DBFENTER;
 	
-	if ( llc->cmdwq != NULL ){
-		llc->cmdstatus = status;
-		wake_up_interruptible(&(llc->cmdwq));
-	}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
+	if ( llc->cmdwq != NULL )
+#endif
+	  {
+	    llc->cmdstatus = status;
+	    wake_up_interruptible(&(llc->cmdwq));
+	  }
 
 	DBFEXIT;
 	return;
@@ -449,8 +472,9 @@
 				/* Now, do an interruptible_sleep, we'll be awakened by: */
 				/*  a signal the process, cmdtimerfunc (timeout), or llc_scancomplete */
 				interruptible_sleep_on(&(llc->cmdwq));
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
 				llc->cmdwq = NULL;
-
+#endif
 				/* If sleep return is via signal */
 				if ( signal_pending(current) ) {
 					WLAN_LOG_DEBUG0(2,"Scan unblocked via signal\n");
@@ -578,7 +602,9 @@
 				/* Now, do an interruptible_sleep, we'll be awakened by: */
 				/*  a signal the process, cmdtimerfunc (timeout), or llc_scancomplete */
 				interruptible_sleep_on(&(llc->cmdwq));
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
 				llc->cmdwq = NULL;
+#endif
 
 				/* If sleep return is via signal */
 				if ( signal_pending(current) ) {
@@ -622,7 +648,9 @@
 				/* Now, do an interruptible_sleep, we'll be awakened by: */
 				/*  a signal the process, cmdtimerfunc (timeout), or llc_scancomplete */
 				interruptible_sleep_on(&(llc->cmdwq));
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
 				llc->cmdwq = NULL;
+#endif
 
 				/* If sleep return is via signal */
 				if ( signal_pending(current) ) {
@@ -655,7 +683,7 @@
 				UINT32	size = 0;
 				UINT32	mibcode;
 				
-				p = kmalloc(req->len, GFP_KERNEL);
+				p = (UINT8*)kmalloc(req->len, GFP_KERNEL);
 				if (p == NULL) {
 					result = -ENOMEM;
 					break;
@@ -855,7 +883,7 @@
 
 	DBFENTER;
 
-	if ( dev->start == 1 )
+	if ( netif_running( dev ))
 	{
 		/* If some higher layer thinks we've missed a tx-done, we are passed
 			NULL. Caution: dev_tint handles the cli/sti ..
@@ -869,7 +897,9 @@
 		}
 #endif
 
-		if ( test_and_set_bit(0, (void*)&(dev->tbusy)) != 0 )
+		/* XXX check logic here */
+		netif_stop_queue( dev );
+		if ( !netif_queue_stopped( dev ))
 		{
 			/* TODO: add a f/w reset capability here. see skeleton.c */
 			WLAN_LOG_DEBUG2(1, "called when tbusy set,"
@@ -908,7 +938,7 @@
 		
 					if ( txresult == 0)  /* success and more buf avail, re: hw_txdata */
 					{
-						dev->tbusy = 0;
+					  netif_wake_queue( dev );
 						result = 0;
 					}
 					else if ( txresult == 1 ) /* success, no more avail */
@@ -948,9 +978,7 @@
 	DBFENTER;
 
 	/* set the flags in the device object */
-	dev->tbusy = 0;
-	dev->interrupt = 0;
-	dev->start = 1;
+	netif_start_queue( dev ); /* fixme attach? */
 
 	#ifdef WLAN_PCMCIA
 	MOD_INC_USE_COUNT;
@@ -975,8 +1003,7 @@
 	DBFENTER;
 
 	/* set the flags in the device object */
-	dev->start = 0;
-	dev->tbusy = 1;
+	netif_stop_queue( dev ); /* detach? */
 
 	#ifdef WLAN_PCMCIA
 	MOD_DEC_USE_COUNT;
@@ -1345,11 +1372,7 @@
 ----------------------------------------------------------------*/
 void am930llc_pbfreeskb( void *buf, int size )
 {
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0))
-	dev_kfree_skb( (struct sk_buff*)buf, FREE_WRITE);
-#else
-	dev_kfree_skb( (struct sk_buff*)buf );
-#endif
+	dev_kfree_skb_any( (struct sk_buff*)buf );
 }
 
 
@@ -1446,9 +1469,9 @@
 
 	DBFENTER;
 
-	llc->dev->interrupt = 1;
+	/* llc->dev->interrupt = 1; */ /* fixme */
 
-	if ( llc->dev->start )
+	if ( netif_running( llc->dev ))
 	{
 		if ( am930llc_pb_p80211_to_ether(llc, pb) == 0 )
 		{
@@ -1470,7 +1493,7 @@
 		}
 	}
 
-	llc->dev->interrupt = 0;
+	/* llc->dev->interrupt = 0; */ /* fixme */
 
 	am930llc_pbfree(pb);
 
@@ -1631,8 +1654,7 @@
 		V2P(llc->dev->priv)->stats.tx_packets++;
 	}
 
-	llc->dev->tbusy = 0;
-	mark_bh(NET_BH);
+	netif_wake_queue( llc->dev );
 
 	DBFEXIT;
 	return;
diff -Naur linux-wlan-0.3.4/driver/am930llc.h linux-wlan-0.3.5-pre1/driver/am930llc.h
--- linux-wlan-0.3.4/driver/am930llc.h	1999-11-06 02:21:07.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/am930llc.h	2004-06-23 21:56:13.000000000 +0100
@@ -48,7 +48,7 @@
 /*--- Types ---------------------------------------------------*/
 /*=============================================================*/
 
-#if LINUX_VERSION_CODE < 0x2030e
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,14)
 typedef struct device device_t;   /* see linux/netdevice.h */
 #else
 typedef struct net_device device_t;   /* see linux/netdevice.h */
@@ -251,7 +251,7 @@
 	/* component pointers */
 	struct am930mac		*mac;
 	struct am930mgr		*mgr;
-	device_t			*dev;
+	device_t		*dev;
 
 	/* Main timer, distributes ticks to the rest of the driver */
 	struct timer_list	timer;
@@ -261,7 +261,11 @@
 	UINT				cmdbusy;
 	UINT				currcmd;
 	struct timer_list	cmdtimer;	/* ioctl cmd timeout timer */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,18)
 	struct wait_queue	*cmdwq;		/* ioctl blocking wait queue */
+#else
+        wait_queue_head_t cmdwq;
+#endif
 
 	/* Implementation specific config items */
 	int					ethconv;
diff -Naur linux-wlan-0.3.4/driver/am930mac.c linux-wlan-0.3.5-pre1/driver/am930mac.c
--- linux-wlan-0.3.4/driver/am930mac.c	1999-11-06 02:21:07.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/am930mac.c	2004-06-24 23:41:05.000000000 +0100
@@ -31,6 +31,7 @@
 
 
 #include <linux/config.h>
+#include <linux/version.h>
 #include <wlan/wlan_compat.h>
 
 #if (WLAN_OS == WLAN_LINUX_KERNEL)
@@ -40,12 +41,12 @@
 
 /* PCMCIA headers generated during PCMCIA package installation */
 #ifdef WLAN_PCMCIA
-#include <pcmcia/config.h>
+#ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
 #endif
+#endif
 
 /* Module related headers, non-module drivers should not include */
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -67,7 +68,11 @@
 #include <linux/in.h>
 #include <linux/ptrace.h>
 #include <linux/interrupt.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
 #include <linux/malloc.h>
+#else
+#include <linux/slab.h>
+#endif
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/kernel_stat.h>
@@ -156,8 +161,10 @@
 static void am930mac_timerfunc(am930mac_t *mac);
 
 static void am930mac_crc32_mktable(am930mac_t *mac);
+#ifdef AM930CRC
 static UINT32 am930mac_crc32_block(am930mac_t *mac, UINT32 reg, UINT8 *p, UINT len);
 static UINT32 am930mac_crc32_blockfinish(am930mac_t *mac, UINT32 reg);
+#endif
 /*  static UINT32 am930mac_crc32_accum(am930mac_t *mac, UINT32 reg, UINT8 d); */
 
 /*================================================================*/
@@ -376,7 +383,7 @@
 	return;
 }
 
-
+#ifdef AM930CRC
 /*----------------------------------------------------------------
 *	am930mac_crc32_block
 *
@@ -408,6 +415,7 @@
 {
 	return reg ^ 0xffffffffUL;
 }
+#endif
 
 
 /*----------------------------------------------------------------
diff -Naur linux-wlan-0.3.4/driver/am930mgr.c linux-wlan-0.3.5-pre1/driver/am930mgr.c
--- linux-wlan-0.3.4/driver/am930mgr.c	1999-11-06 02:21:08.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/am930mgr.c	2004-06-22 00:01:11.000000000 +0100
@@ -31,6 +31,7 @@
 
 
 #include <linux/config.h>
+#include <linux/version.h>
 #include <wlan/wlan_compat.h>
 
 #if (WLAN_OS == WLAN_LINUX_KERNEL)
@@ -40,9 +41,10 @@
 
 /* PCMCIA headers generated during PCMCIA package installation */
 #ifdef WLAN_PCMCIA
-#include <pcmcia/config.h>
+#ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
 #endif
+#endif
 
 /* Module related headers, non-module drivers should not include */
 #include <linux/version.h>
@@ -68,7 +70,11 @@
 #include <linux/ptrace.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
 #include <linux/malloc.h>
+#else
+#include <linux/slab.h>
+#endif
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <asm/bitops.h>
@@ -169,7 +175,9 @@
 
 static UINT8 am930mgr_rates_max(wlan_ie_supp_rates_t *rates);
 
+#ifdef AM930TFUNC
 static void am930mgr_timerfunc(am930mgr_t *mgr);
+#endif
 
 /*================================================================*/
 /* Local Statics  */
@@ -236,6 +244,7 @@
 }
 
 
+#ifdef AM930TFUNC
 /*----------------------------------------------------------------
 *	am930mgr_timerfunc
 *
@@ -322,7 +331,7 @@
 	DBFEXIT;
 	return;
 }
-
+#endif
 
 /*----------------------------------------------------------------
 *	am930mgr_destruct
diff -Naur linux-wlan-0.3.4/driver/am930mod.c linux-wlan-0.3.5-pre1/driver/am930mod.c
--- linux-wlan-0.3.4/driver/am930mod.c	1999-11-06 02:21:08.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/am930mod.c	2004-06-20 01:38:54.000000000 +0100
@@ -35,10 +35,10 @@
 */
 
 #include <linux/config.h>
+#include <linux/version.h>
 #include <wlan/wlan_compat.h>
 
 /* Module related headers, non-module drivers should not include */
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -51,16 +51,18 @@
 #include <linux/if_arp.h>
 
 /* Standard driver includes */
-#include <linux/kernel.h>
 #include <linux/types.h>
-#include <linux/sched.h>
 #include <linux/fcntl.h>
 #include <asm/system.h>
 #include <linux/ptrace.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
 #include <linux/malloc.h>
+#else
+#include <linux/slab.h>
+#endif
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/kernel_stat.h>
diff -Naur linux-wlan-0.3.4/driver/Makefile linux-wlan-0.3.5-pre1/driver/Makefile
--- linux-wlan-0.3.4/driver/Makefile	1999-11-06 02:21:06.000000000 +0000
+++ linux-wlan-0.3.5-pre1/driver/Makefile	2004-07-30 15:44:29.000000000 +0100
@@ -46,9 +46,22 @@
 	$(CC) -c $(CFLAGS) $(CPPFLAGS) -DWLAN_PCMCIA $< -o $@
 
 # Compiler flags
+ifeq "" "$(PCMCIA_SRC)"
+INCFLAGS=-I$(LINUX_SRC)/include
+else
+# This is a fairly blunt determination of whether we should include
+# PCMCIA source before kernel or vice versa
+ifeq (,$(wildcard $(PCMCIA_SRC)/include/pcmcia/config.h))
+INCFLAGS=-I$(PCMCIA_SRC)/include -I$(PCMCIA_SRC)/modules \
+	 -I$(LINUX_SRC)/include -D__IN_PCMCIA_PACKAGE__
+else
+INCFLAGS=-I$(LINUX_SRC)/include -D__IN_PCMCIA_PACKAGE__\
+	 -I$(PCMCIA_SRC)/include -I$(PCMCIA_SRC)/modules
+endif
+endif
+
 CPPFLAGS=-D__LINUX_WLAN__ -D__KERNEL__ -DMODULE=1 \
-	-I../include -I$(LINUX_SRC)/include -I$(PCMCIA_SRC)/include \
-	-I$(PCMCIA_SRC)/modules \
+	-I../include $(INCFLAGS)\
 	$(WLAN_INCLUDE_DEBUG) $(WLAN_INCLUDE_SNIF)
 
 # Source and obj definitions for ISA
@@ -119,10 +132,12 @@
 ifneq "" "$(findstring $(MAKE_CS), yY)"
 	mkdir -p $(MODDIR)/pcmcia
 	cp -p $(CS_MODULE)  $(MODDIR)/pcmcia
+	chown root.root $(MODDIR)/pcmcia/$(CS_MODULE)
 endif
 ifneq "" "$(findstring $(MAKE_ISA), yY)"
 	mkdir -p $(MODDIR)/net
 	cp -p $(ISA_MODULE) $(MODDIR)/net
+	chown root.root $(MODDIR)/net/$(ISA_MODULE)
 endif
 
 clean: 
@@ -130,7 +145,7 @@
 	rm -f ../p80211/*.o ../p80211.*.o ../p80211/*.s ../p80211*.a 
 	rm -f ../p80211/.depend ../p80211/tmp_make ../p80211/*~
 	rm -fr $(CS_OBJ_DIR) $(ISA_OBJ_DIR)
-	
+
 #
 # Include a dependency file (if one exists)
 #
diff -Naur linux-wlan-0.3.4/include/wlan/version.h linux-wlan-0.3.5-pre1/include/wlan/version.h
--- linux-wlan-0.3.4/include/wlan/version.h	1999-11-06 02:21:09.000000000 +0000
+++ linux-wlan-0.3.5-pre1/include/wlan/version.h	2004-08-04 23:06:09.000000000 +0100
@@ -1,3 +1,3 @@
 
-#define WLAN_RELEASE		"0.3.4"
-#define WLAN_RELEASE_CODE	0x000304
+#define WLAN_RELEASE		"0.3.5-pre1"
+#define WLAN_RELEASE_CODE	0x000305
diff -Naur linux-wlan-0.3.4/include/wlan/wlan_compat.h linux-wlan-0.3.5-pre1/include/wlan/wlan_compat.h
--- linux-wlan-0.3.4/include/wlan/wlan_compat.h	1999-11-06 02:21:09.000000000 +0000
+++ linux-wlan-0.3.5-pre1/include/wlan/wlan_compat.h	2004-08-02 11:51:13.000000000 +0100
@@ -421,14 +421,39 @@
 	#define am930shim_rxframe(o,p)				am930llc_rxframe((o), (p))
 	#define am930shim_ontxcomplete(o,r)			am930llc_ontxcomplete((o), (r))
 	typedef	UINT32								wlan_flags_t;
-	#ifdef CONFIG_MODVERSIONS
-		#define MODVERSIONS		1
-		#include <linux/modversions.h>
-	#endif
 
-	#ifdef CONFIG_SMP
-		#define __SMP__			1
-	#endif	
+#ifdef CONFIG_MODVERSIONS
+#define MODVERSIONS		1
+#include <linux/modversions.h>
+#endif
+#ifdef CONFIG_SMP
+#define __SMP__			1
+#endif	
+#ifndef kfree_s /* XXX */
+#define kfree_s(p,l)                        kfree((p))
+#endif
+
+/* according to pcmcia/k_compat.h these are deprecated, but we'll
+   include 'em here for now. */
+#ifndef __IN_PCMCIA_PACKAGE__
+#define RUN_AT(x)(jiffies+(x))
+#define IRQ_MAP(irq, dev)do { } while (0)
+#define IRQ(a,b,c) (a,b,c)
+#define DEV_ID dev_id
+#endif
+
+/* from linux/wanpipe.h, more or less */
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,3,0)
+#include <pcmcia/version.h>
+#if CS_RELEASE_CODE < 0x3118 /* not accurate */
+#define netif_stop_queue(a) (set_bit(0, &##a->tbusy)) 
+#define netif_start_queue(a) (clear_bit(0,&##a->tbusy))
+#define netif_queue_stopped(a)(##a->tbusy)
+#define netif_wake_queue(a){clear_bit(0,&##a->tbusy);mark_bh(NET_BH);}
+#define netif_running(a)(test_bit(0,&##a->start))
+#endif
+#define dev_kfree_skb_any(a)dev_kfree_skb(a)
+#endif
 
 #elif (WLAN_OS == WLAN_LWOS)
 	#define atomic_t							UINT32
diff -Naur linux-wlan-0.3.4/Makefile linux-wlan-0.3.5-pre1/Makefile
--- linux-wlan-0.3.4/Makefile	1999-11-06 02:21:05.000000000 +0000
+++ linux-wlan-0.3.5-pre1/Makefile	2004-08-04 19:33:55.000000000 +0100
@@ -1,4 +1,4 @@
-DIRS = driver wlanctl wlandump man
+DIRS = driver wlanctl wlandump man scripts
 
 all:
 	set -e; for d in $(DIRS); do $(MAKE) -C $$d ; done
diff -Naur linux-wlan-0.3.4/p80211/p80211.c linux-wlan-0.3.5-pre1/p80211/p80211.c
--- linux-wlan-0.3.4/p80211/p80211.c	1999-11-06 02:21:10.000000000 +0000
+++ linux-wlan-0.3.5-pre1/p80211/p80211.c	2004-06-23 23:31:22.000000000 +0100
@@ -23,6 +23,7 @@
 */
 
 #include <linux/config.h>
+#include <linux/version.h>
 #include <wlan/wlan_compat.h>
 
 #if (WLAN_OS == WLAN_LINUX_KERNEL)
@@ -30,10 +31,7 @@
 /* The following prevents "kernel_version" from being set in this file. */
 #define __NO_VERSION__
 
-#include <linux/version.h>
-#include <linux/modversions.h>
 #include <linux/module.h>
-#include <linux/kernel.h>
 #include <linux/string.h>
 
 /* Standard driver includes */
diff -Naur linux-wlan-0.3.4/README linux-wlan-0.3.5-pre1/README
--- linux-wlan-0.3.4/README	1999-11-06 02:21:05.000000000 +0000
+++ linux-wlan-0.3.5-pre1/README	2004-08-04 23:05:53.000000000 +0100
@@ -1,5 +1,5 @@
 Linux WLAN package
-version 0.3.4
+version 0.3.5-pre1
 
 INTRODUCTION
 This package contains a device driver and support utility for GNU/Linux
diff -Naur linux-wlan-0.3.4/scripts/Makefile linux-wlan-0.3.5-pre1/scripts/Makefile
--- linux-wlan-0.3.4/scripts/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ linux-wlan-0.3.5-pre1/scripts/Makefile	2004-08-04 19:42:09.000000000 +0100
@@ -0,0 +1,11 @@
+include ../config.mk
+
+all:
+	@echo "Nothing to do..."
+
+install:
+	install -m 755 wlan /etc/pcmcia/
+	install -m 755 wlan.config /etc/pcmcia/wlan.conf
+	install -m 644 wlan.opts /etc/pcmcia/
+
+clean:
diff -Naur linux-wlan-0.3.4/scripts/Makefile~ linux-wlan-0.3.5-pre1/scripts/Makefile~
--- linux-wlan-0.3.4/scripts/Makefile~	1970-01-01 01:00:00.000000000 +0100
+++ linux-wlan-0.3.5-pre1/scripts/Makefile~	2004-08-04 19:35:05.000000000 +0100
@@ -0,0 +1,5 @@
+all:
+	echo "Nothing to do for scripts directory"
+
+install:
+	
diff -Naur linux-wlan-0.3.4/scripts/rc.wlan linux-wlan-0.3.5-pre1/scripts/rc.wlan
--- linux-wlan-0.3.4/scripts/rc.wlan	1999-11-06 02:21:10.000000000 +0000
+++ linux-wlan-0.3.5-pre1/scripts/rc.wlan	2004-08-04 23:07:47.000000000 +0100
@@ -114,7 +114,7 @@
 
 if is_true "$SCAN"; then
 	# Scan for existing networks
-	echo "wlan scanning channels $STARTCH to $ENDCH"
+	echo "wlan scanning channels $SCAN_STARTCH to $SCAN_ENDCH"
 	netlist=`wlanctl $DEVICE scan \
 		$SCAN_STARTCH $SCAN_ENDCH $SCAN_TIMEPERCHANNEL \
 		$SCAN_BSSID $SCAN_BSSTYPE $SCAN_TYPE "$SCAN_SSID"`
@@ -175,7 +175,7 @@
 			"channel=$CREATE_CHANNEL and" \
 			"ssid=$CREATE_SSID"
 
-		$DESIRED_SSID=$CREATE_SSID
+		DESIRED_SSID=$CREATE_SSID
 	else
 		echo "wlan failed to find ssid=$DESIRED_SSID"
 		exit 1
diff -Naur linux-wlan-0.3.4/scripts/wlan linux-wlan-0.3.5-pre1/scripts/wlan
--- linux-wlan-0.3.4/scripts/wlan	1999-11-06 02:21:10.000000000 +0000
+++ linux-wlan-0.3.5-pre1/scripts/wlan	2004-07-30 14:02:58.000000000 +0100
@@ -38,7 +38,7 @@
 'start')
 
 	# Scan for existing networks
-	echo "wlan scanning channels $STARTCH to $ENDCH"
+	echo "wlan scanning channels $SCAN_STARTCH to $SCAN_ENDCH"
 	netlist=`wlanctl $DEVICE scan \
 		$SCAN_STARTCH $SCAN_ENDCH $SCAN_TIMEPERCHANNEL \
 		$SCAN_BSSID $SCAN_BSSTYPE $SCAN_TYPE "$SCAN_SSID"`
@@ -98,7 +98,7 @@
 				"channel=$CREATE_CHANNEL and" \
 				"ssid=$CREATE_SSID"
 
-			$DESIRED_SSID=$CREATE_SSID
+			DESIRED_SSID=$CREATE_SSID
 		else
 			echo "wlan failed to find ssid=$DESIRED_SSID"
 			exit 1
diff -Naur linux-wlan-0.3.4/wlanctl/Makefile linux-wlan-0.3.5-pre1/wlanctl/Makefile
--- linux-wlan-0.3.4/wlanctl/Makefile	1999-11-06 02:23:32.000000000 +0000
+++ linux-wlan-0.3.5-pre1/wlanctl/Makefile	2004-06-19 11:39:14.000000000 +0100
@@ -6,7 +6,7 @@
 CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -pipe -D__LINUX_WLAN__ -D__I386__
 endif
 
-CPPFLAGS = -I../include -I$(LINUX)/include
+CPPFLAGS = -I../include -I$(LINUX_SRC)/include
 
 
 SRCS = main.c prmib.c
@@ -16,7 +16,8 @@
 	cc -o wlanctl main.o prmib.o
 
 install:
-	cp -p wlanctl $(INST_EXEDIR)
+	mkdir -p $(DESTDIR)$(INST_EXEDIR)
+	cp -p wlanctl $(DESTDIR)$(INST_EXEDIR)
 
 clean: 
 	rm -f wlanctl core core.* *.o .*.o *.s *.a .depend tmp_make *~
diff -Naur linux-wlan-0.3.4/wlandump/Makefile linux-wlan-0.3.5-pre1/wlandump/Makefile
--- linux-wlan-0.3.4/wlandump/Makefile	1999-11-06 02:23:53.000000000 +0000
+++ linux-wlan-0.3.5-pre1/wlandump/Makefile	2004-06-19 11:39:07.000000000 +0100
@@ -6,7 +6,7 @@
 CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -pipe -D__LINUX_WLAN__ -D__I386__
 endif
 
-CPPFLAGS = -I../include -I$(LINUX)/include
+CPPFLAGS = -I../include -I$(LINUX_SRC)/include
 
 
 wlandump: wlandump.o prframe.o p80211.o wep.o
@@ -16,7 +16,8 @@
 	cc -c $(CFLAGS) $(CPPFLAGS) -o ./p80211.o  ../p80211/p80211.c
 
 install:
-	cp -p wlandump $(INST_EXEDIR)
+	mkdir -p $(DESTDIR)$(INST_EXEDIR)
+	cp -p wlandump $(DESTDIR)$(INST_EXEDIR)
 
 clean: 
 	rm -f wlandump core core.* *.o .*.o *.s *.a .depend tmp_make *~
diff -Naur linux-wlan-0.3.4/wlandump/wep.c linux-wlan-0.3.5-pre1/wlandump/wep.c
--- linux-wlan-0.3.4/wlandump/wep.c	1999-11-06 02:21:11.000000000 +0000
+++ linux-wlan-0.3.5-pre1/wlandump/wep.c	2004-06-23 23:23:14.000000000 +0100
@@ -31,6 +31,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <wlan/wlan_compat.h>
 #include <wlan/version.h>
 #include <wlan/p80211hdr.h>

