diff -purN pcmcia-cs-3.2.0.orig/Configure pcmcia-cs-3.2.0/Configure
--- pcmcia-cs-3.2.0.orig/Configure	Mon Jun 10 07:02:31 2002
+++ pcmcia-cs-3.2.0/Configure	Mon Sep 30 13:28:00 2002
@@ -482,6 +482,9 @@ printconfig () {
 	printflag "IBM 4xx processor" CONFIG_4xx
     	printflag "Embedded Planet LITE platform" CONFIG_RPXLITE
     	printflag "Embedded Planet CLASSIC platfom" CONFIG_RPXCLASSIC
+    	printflag "ICU862 platform" CONFIG_ICU862
+    	printflag "C2MON platform" CONFIG_C2MON
+    	printflag "TQM8xx platform" CONFIG_TQM8xxL
     	printflag "MPC823 processor" CONFIG_MPC823
     	printflag "MPC850 processor" CONFIG_MPC850
     	printflag "MPC860 processor" CONFIG_MPC860
@@ -646,7 +649,7 @@ case $CONF_SRC in
 	fi
 	if [ $ARCH = "ppc" ] ; then
 	    for C in 8xx 4xx RPXLITE RPXCLASSIC MPC823 MPC850 MPC860 \
-		MPC860T ALL_PPC ; do
+		MPC860T ICU862 C2MON TQM8xxL ALL_PPC ; do
 		configcheck $C
 	    done
 	fi
@@ -968,6 +971,7 @@ write_str XMANDIR
 
 echo "" >> $CONFIG_H
 echo "#endif /* _PCMCIA_CONFIG_H */" >> $CONFIG_H
+echo "#include_next <linux/config.h>" >> $CONFIG_H
 
 mv $CONFIG config.out
 
diff -purN pcmcia-cs-3.2.0.orig/Makefile pcmcia-cs-3.2.0/Makefile
--- pcmcia-cs-3.2.0.orig/Makefile	Sat Dec  1 02:17:24 2001
+++ pcmcia-cs-3.2.0/Makefile	Mon Sep 30 13:28:00 2002
@@ -24,7 +24,7 @@ help:
 config .prereq.ok:
 	@touch config.mk
 	@$(MAKE) -s clean
-	@./Configure
+	@./Configure --arch=ppc  --ucc=ppc_8xx-gcc --kcc=ppc_8xx-gcc --ld=ppc_8xx-ld --target=$$PWD/../pcmcia
 
 oldconfig:
 	@touch config.mk
diff -purN pcmcia-cs-3.2.0.orig/etc/cis/ARGOSY.cis pcmcia-cs-3.2.0/etc/cis/ARGOSY.cis
--- pcmcia-cs-3.2.0.orig/etc/cis/ARGOSY.cis	Thu Jan  1 01:00:00 1970
+++ pcmcia-cs-3.2.0/etc/cis/ARGOSY.cis	Mon Sep 30 13:28:00 2002
@@ -0,0 +1,9 @@
+  vers_1 4.1, "ARGOSY", "PnPIDE", "D5"
+  manfid 0x0311, 0x0556
+  config base 0x0100 mask 0x0003 last_index 0x03
+  cftable_entry 0x01 [default]
+    [mwait]
+    io 0x0320-0x0321 [16bit] [range]
+    io 0x0322-0x0329 [8bit] [range]
+    irq mask 0x9eb8 [level]
+
diff -purN pcmcia-cs-3.2.0.orig/etc/config pcmcia-cs-3.2.0/etc/config
--- pcmcia-cs-3.2.0.orig/etc/config	Sun Jul 21 06:14:01 2002
+++ pcmcia-cs-3.2.0/etc/config	Mon Sep 30 13:28:00 2002
@@ -1860,6 +1860,7 @@

 card "Argosy PnPIDE"
   version "ARGOSY", "PnPIDE"
+  cis "cis/ARGOSY.dat"
   bind "ide-cs"

 card "Caravelle CD-36N/CD-36E CD-ROM"
diff -purN pcmcia-cs-3.2.0.orig/etc/rc.pcmcia pcmcia-cs-3.2.0/etc/rc.pcmcia
--- pcmcia-cs-3.2.0.orig/etc/rc.pcmcia	Sat Jul 20 22:51:09 2002
+++ pcmcia-cs-3.2.0/etc/rc.pcmcia	Mon Sep 30 13:28:00 2002
@@ -35,7 +35,7 @@ elif [ -f /etc/sysconfig/pcmcia ] ; then
 else
     # Slackware startup options go right here:
     # Should be either i82365 or tcic
-    PCIC=i82365
+    PCIC=m8xx_pcmcia
     # Put socket driver timing parameters here
     PCIC_OPTS=
     # Put pcmcia_core options here
diff -purN pcmcia-cs-3.2.0.orig/include/linux/kernel.h pcmcia-cs-3.2.0/include/linux/kernel.h
--- pcmcia-cs-3.2.0.orig/include/linux/kernel.h	Sat Jun 29 08:44:31 2002
+++ pcmcia-cs-3.2.0/include/linux/kernel.h	Mon Sep 30 16:41:13 2002
@@ -7,7 +7,9 @@
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,1,16))
 #define AUTOCONF_INCLUDED
+#ifndef EXPORT_SYMTAB
 #define EXPORT_SYMTAB
+#endif
 #define register_symtab(x)
 #endif
 #ifdef CONFIG_MODVERSIONS
diff -purN pcmcia-cs-3.2.0.orig/include/pcmcia/ciscode.h pcmcia-cs-3.2.0/include/pcmcia/ciscode.h
--- pcmcia-cs-3.2.0.orig/include/pcmcia/ciscode.h	Mon Jun 10 06:47:00 2002
+++ pcmcia-cs-3.2.0/include/pcmcia/ciscode.h	Mon Sep 30 13:28:00 2002
@@ -132,4 +132,7 @@
 
 #define MANFID_OXSEMI			0x0279
 
+#define MANFID_ARGOSY			0x0311
+#define PRODID_ARGOSY_D5		0x0556
+
 #endif /* _LINUX_CISCODE_H */
diff -purN pcmcia-cs-3.2.0.orig/modules/cs.c pcmcia-cs-3.2.0/modules/cs.c
--- pcmcia-cs-3.2.0.orig/modules/cs.c	Sat Jun 29 08:23:09 2002
+++ pcmcia-cs-3.2.0/modules/cs.c	Mon Sep 30 13:28:00 2002
@@ -1990,7 +1990,11 @@ static int suspend_card(client_handle_t 
 
     DEBUG(1, "cs: suspending socket %d\n", i);
     send_event(s, CS_EVENT_PM_SUSPEND, CS_EVENT_PRI_LOW);
+#if 0 /* On MPC862 the event is processed _after_ the io is unmapped
+		 and caused the 'machine check' exception.
+	  */
     s->ss_entry(s->sock, SS_SetSocket, &dead_socket);
+#endif
     s->state |= SOCKET_SUSPEND;
 
     return CS_SUCCESS;
diff -purN pcmcia-cs-3.2.0.orig/modules/m8xx_pcmcia.c pcmcia-cs-3.2.0/modules/m8xx_pcmcia.c
--- pcmcia-cs-3.2.0.orig/modules/m8xx_pcmcia.c	Fri Jul  5 00:24:57 2002
+++ pcmcia-cs-3.2.0/modules/m8xx_pcmcia.c	Mon Sep 30 16:30:36 2002
@@ -69,6 +69,24 @@ static const char *version = "Version 0.
  
 #if !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B)
 
+/* The TQM8xx series use SLOT_B */
+
+#if defined(CONFIG_TQM8xxL)
+#define CONFIG_PCMCIA_SLOT_B
+#endif
+
+/* The C2MON uses SLOT_B */
+
+#ifdef CONFIG_C2MON
+#define CONFIG_PCMCIA_SLOT_B
+#endif
+
+/* The ICU862 uses SLOT_B */
+
+#ifdef CONFIG_ICU862
+#define CONFIG_PCMCIA_SLOT_B
+#endif
+
 /* The RPX series use SLOT_B */
 
 #if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE)
@@ -235,7 +253,7 @@ static socket_cap_t capabilities = {
     SS_CAP_PCCARD | SS_CAP_MEM_ALIGN | SS_CAP_STATIC_MAP,
     0x000,		/* SIU_LEVEL 7 -> 0          */
     0x1000,		/* 4K minimum window size    */
-    9, 0		/* No PCI or CardBus support */
+    7, 0		/* No PCI or CardBus support */
 };
 
 /* 
@@ -268,6 +286,842 @@ static int m8xx_service(u_int sock, u_in
 /* board specific stuff:                                                     */
 /* voltage_set(), hardware_enable() and hardware_disable()                   */
 /* ------------------------------------------------------------------------- */
+
+
+
+/* ------------------------------------------------------------------------- */
+/* TQM8xxL Boards by TQ Components                                           */
+
+#if defined(CONFIG_TQM8xxL)
+
+#define PCMCIA_BOARD_MSG "TQM8xxL"
+
+/*
+ * The TQM850L hardware has two pins swapped! Grrrrgh!
+ */
+#ifdef	CONFIG_TQM850L
+#define __MY_PCMCIA_GCRX_CXRESET	M8XX_PGCRX_CXOE
+#define __MY_PCMCIA_GCRX_CXOE		M8XX_PGCRX_CXRESET
+#else
+#define __MY_PCMCIA_GCRX_CXRESET	M8XX_PGCRX_CXRESET
+#define __MY_PCMCIA_GCRX_CXOE		M8XX_PGCRX_CXOE
+#endif
+
+static int hardware_enable(int slot)
+{
+	volatile immap_t	*immap;
+	volatile cpm8xx_t	*cp;
+	volatile pcmconf8xx_t	*pcmp;
+	volatile sysconf8xx_t	*sysp;
+	uint reg, mask;
+
+	DEBUG (3,"hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+	udelay(10000);
+
+	immap = (immap_t *)IMAP_ADDR;
+	sysp  = (sysconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_siu_conf));
+	pcmp  = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia));
+	cp    = (cpm8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_cpm));
+
+	/*
+	 * Configure SIUMCR to enable PCMCIA port B
+	 * (VFLS[0:1] are not used for debugging, we connect FRZ# instead)
+	 */
+
+	#define SIUMCR_DBGC11 0x00600000
+	sysp->sc_siumcr &= ~SIUMCR_DBGC11;	/* set DBGC to 00 */
+
+	/* clear interrupt state, and disable interrupts */
+	pcmp->pcmc_pscr =  M8XX_PCMCIA_MASK(_slot_);
+	pcmp->pcmc_per &= ~M8XX_PCMCIA_MASK(_slot_);
+
+	/* disable interrupts & DMA */
+	M8XX_PGCRX(_slot_) = 0;
+
+	/*
+	 * Disable PCMCIA buffers (isolate the interface)
+	 * and assert RESET signal
+	 */
+	DEBUG (3,"Disable PCMCIA buffers and assert RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg |=  __MY_PCMCIA_GCRX_CXRESET;	/* active high */
+	reg |=  __MY_PCMCIA_GCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+	udelay(500);
+
+	/*
+	 * Configure Port C pins for
+	 * 5 Volts Enable and 3 Volts enable
+	 */
+	immap->im_ioport.iop_pcpar &= ~(0x0002 | 0x0004);
+	immap->im_ioport.iop_pcso  &= ~(0x0002 | 0x0004);
+	/* remove all power */
+
+	immap->im_ioport.iop_pcdat &= ~(0x0002 | 0x0004);
+
+	/*
+	 * Make sure there is a card in the slot, then configure the interface.
+	 */
+	udelay(10000);
+	DEBUG (3,"[%d] %s: PIPR(%p)=0x%x\n",
+		__LINE__,__FUNCTION__,
+		&(pcmp->pcmc_pipr),pcmp->pcmc_pipr);
+	if (pcmp->pcmc_pipr & 0x00001800) {
+		DEBUG (3,"   No Card found\n");
+		return (1);
+	}
+
+	/*
+	 * Power On.
+	 */
+	mask = M8XX_PCMCIA_VS1(slot) | M8XX_PCMCIA_VS2(slot);
+	reg  = pcmp->pcmc_pipr;
+	DEBUG (3,"PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n",
+		reg,
+		(reg&M8XX_PCMCIA_VS1(slot))?"n":"ff",
+		(reg&M8XX_PCMCIA_VS2(slot))?"n":"ff");
+	if ((reg & mask) == mask) {
+		immap->im_ioport.iop_pcdat |= 0x0004;
+		DEBUG (3," 5.0V card found: ");
+	} else {
+		immap->im_ioport.iop_pcdat |= 0x0002;
+		DEBUG (3," 3.3V card found: ");
+	}
+	immap->im_ioport.iop_pcdir |=  (0x0002 | 0x0004);
+#if 0
+	/*  VCC switch error flag, PCMCIA slot INPACK_ pin */
+	cp->cp_pbdir &= ~(0x0020 | 0x0010);
+	cp->cp_pbpar &= ~(0x0020 | 0x0010);
+	udelay(500000);
+#endif
+	DEBUG (3,"Enable PCMCIA buffers and stop RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg &= ~__MY_PCMCIA_GCRX_CXRESET;	/* active high */
+	reg &= ~__MY_PCMCIA_GCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+
+	udelay(250000);	/* some cards need >150 ms to come up :-( */
+
+	DEBUG (3,"# hardware_enable done\n");
+
+	return (0);
+}
+
+static int hardware_disable(int slot)
+{
+	volatile immap_t	*immap;
+	volatile pcmconf8xx_t	*pcmp;
+	u_long reg;
+
+	DEBUG (3,"hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+	immap = (immap_t *)IMAP_ADDR;
+	pcmp = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia));
+
+	/* remove all power */
+	immap->im_ioport.iop_pcdat &= ~(0x0002 | 0x0004);
+
+	/* Configure PCMCIA General Control Register */
+	M8XX_PGCRX(_slot_) = 0;
+
+	DEBUG (3,"Disable PCMCIA buffers and assert RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg |= __MY_PCMCIA_GCRX_CXRESET;	/* active high */
+	reg |= __MY_PCMCIA_GCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+
+	udelay(10000);
+
+	return (0);
+}
+
+#define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V
+
+static int voltage_set(int slot, int vcc, int vpp)
+{
+	volatile immap_t	*immap;
+	volatile pcmconf8xx_t	*pcmp;
+	u_long reg;
+
+	DEBUG (3,"voltage_set: "	\
+		PCMCIA_BOARD_MSG	\
+		" Slot %c, Vcc=%d.%d, Vpp=%d.%d\n",
+		'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10);
+
+	immap = (immap_t *)IMAP_ADDR;
+	pcmp = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia));
+#if 0
+	/*
+	 * Disable PCMCIA buffers (isolate the interface)
+	 * and assert RESET signal
+	 */
+	DEBUG (3,"Disable PCMCIA buffers and assert RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg |=  __MY_PCMCIA_GCRX_CXRESET;	/* active high */
+	reg |=  __MY_PCMCIA_GCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+#endif
+	udelay(500);
+	/*
+	 * Configure Port C pins for
+	 * 5 Volts Enable and 3 Volts enable,
+	 * Turn off all power
+	 */
+	DEBUG (3,"PCMCIA power OFF\n");
+	immap->im_ioport.iop_pcpar &= ~(0x0002 | 0x0004);
+	immap->im_ioport.iop_pcso  &= ~(0x0002 | 0x0004);
+	immap->im_ioport.iop_pcdat &= ~(0x0002 | 0x0004);
+
+	reg = 0;
+	switch(vcc) {
+	case  0: 		break;
+	case 33: reg |= 0x0002;	break;
+	case 50: reg |= 0x0004;	break;
+	default: 		goto done;
+	}
+
+	/* Checking supported voltages */
+
+	DEBUG (3,"PIPR: 0x%x --> %s\n",
+		pcmp->pcmc_pipr,
+		(pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V");
+
+	immap->im_ioport.iop_pcdat |= reg;
+	immap->im_ioport.iop_pcdir |=  (0x0002 | 0x0004);
+	if (reg) {
+		DEBUG (3,"PCMCIA powered at %sV\n",
+			(reg&0x0004) ? "5.0" : "3.3");
+	} else {
+		DEBUG (3,"PCMCIA powered down\n");
+	}
+
+done:
+#if 0
+	DEBUG (3,"Enable PCMCIA buffers and stop RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg &= ~__MY_PCMCIA_GCRX_CXRESET;	/* active high */
+	reg &= ~__MY_PCMCIA_GCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+#endif
+	udelay(500);
+
+	DEBUG (3,"voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n",
+		slot+'A');
+	return (0);
+}
+
+#endif	/* TQM8xxL */
+
+/* ---------------------------------------------------------------------------- */
+/* C2MON Boards by TTTech Computertechnik AG                    */
+/* ---------------------------------------------------------------------------- */
+
+#if defined(CONFIG_C2MON)
+/*-----------------------------------------------------------------------
+ * PCMCIA Power Switch
+ *
+ * The C2MON uses a TPS2211A PC-Card Power-Interface Switch to
+ * control the voltages on the PCMCIA slot which is connected
+ * to Port C (all outputs) and Port B (Over-Current Input)
+ *-----------------------------------------------------------------------
+ */
+			/* Output pins */
+#define TPS2211_VCCD0	0x0002		/* PC.14 */
+#define TPS2211_VCCD1	0x0004		/* PC.13 */
+#define TPS2211_VPPD0	0x0008		/* PC.12 */
+#define TPS2211_VPPD1	0x0010		/* PC.11 */
+#define TPS2211_OUTPUTS ( TPS2211_VCCD0 | TPS2211_VCCD1 | \
+			  TPS2211_VPPD0 | TPS2211_VPPD1 )
+
+			/* Input pins */
+#define TPS2211_OC	0x00000200	/* PB.22: Over-Current		*/
+#define TPS2211_INPUTS	( TPS2211_OC )
+
+#define PCMCIA_BOARD_MSG "C2MON"
+static void cfg_ports (void);
+#define SIUMCR_DBGC11	0x00600000	/* Debug pins configuration */
+
+static int hardware_enable(int slot)
+{
+	volatile immap_t	*immap;
+	volatile cpm8xx_t	*cp;
+	volatile pcmconf8xx_t	*pcmp;
+	volatile sysconf8xx_t	*sysp;
+	uint reg, pipr, mask;
+	ushort sreg;
+	int i;
+
+	DEBUG (3, "hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+	udelay(10000);
+
+	immap = (immap_t *)IMAP_ADDR;
+	sysp  = (sysconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_siu_conf));
+	pcmp  = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia));
+	cp    = (cpm8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_cpm));
+
+	/* Configure Ports for TPS2211A PC-Card Power-Interface Switch */
+	cfg_ports ();
+
+	/*
+	 * Configure SIUMCR to enable PCMCIA port B
+	 * (VFLS[0:1] are not used for debugging, we connect FRZ# instead)
+	 */
+	sysp->sc_siumcr &= ~SIUMCR_DBGC11;	/* set DBGC to 00 */
+
+	/* clear interrupt state, and disable interrupts */
+	pcmp->pcmc_pscr =  M8XX_PCMCIA_MASK(_slot_);
+	pcmp->pcmc_per &= ~M8XX_PCMCIA_MASK(_slot_);
+
+	/* disable interrupts & DMA */
+	M8XX_PGCRX(_slot_) = 0;
+
+	/*
+	 * Disable PCMCIA buffers (isolate the interface)
+	 * and assert RESET signal
+	 */
+	DEBUG (3, "Disable PCMCIA buffers and assert RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg |=  M8XX_PGCRX_CXRESET;	/* active high */
+	reg |=  M8XX_PGCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+	udelay(500);
+
+	/*
+	 * Make sure there is a card in the slot, then configure the interface.
+	 */
+	udelay(10000);
+	DEBUG (3, "[%d] %s: PIPR(%p)=0x%x\n",
+		__LINE__,__FUNCTION__,
+		&(pcmp->pcmc_pipr),pcmp->pcmc_pipr);
+	if (pcmp->pcmc_pipr & 0x00001800) {
+		DEBUG(0, "   No Card found\n");
+		return (1);
+	}
+
+	/*
+	 * Power On: Set VAVCC to 3.3V or 5V, set VAVPP to Hi-Z
+	 */
+	mask = M8XX_PCMCIA_VS1(slot) | M8XX_PCMCIA_VS2(slot);
+	pipr = pcmp->pcmc_pipr;
+	DEBUG (3, "PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n",
+		pipr,
+		(pipr&M8XX_PCMCIA_VS1(slot))?"n":"ff",
+		(pipr&M8XX_PCMCIA_VS2(slot))?"n":"ff");
+
+	sreg = immap->im_ioport.iop_pcdat;
+	if ((pipr & mask) == mask) {
+		sreg |=  (TPS2211_VPPD0 | TPS2211_VPPD1 |	/* VAVPP => Hi-Z */
+			  TPS2211_VCCD1);			/* 5V on	*/
+		sreg &= ~(TPS2211_VCCD0);			/* 3V off	*/
+		DEBUG (0," 5.0V card found: ");
+	} else {
+		sreg |=  (TPS2211_VPPD0 | TPS2211_VPPD1 |	/* VAVPP => Hi-Z */
+			  TPS2211_VCCD0);			/* 3V on	*/
+		sreg &= ~(TPS2211_VCCD1);			/* 5V off	*/
+		DEBUG (0, " 3.3V card found: ");
+	}
+
+	DEBUG (3, "\nPC DAT: %04x -> 3.3V %s 5.0V %s\n",
+		sreg,
+		( (sreg & TPS2211_VCCD0) && !(sreg & TPS2211_VCCD1)) ? "on" : "off",
+		(!(sreg & TPS2211_VCCD0) &&  (sreg & TPS2211_VCCD1)) ? "on" : "off"
+	);
+
+	immap->im_ioport.iop_pcdat = sreg;
+
+	/*  Wait 500 ms; use this to check for over-current */
+	for (i=0; i<5000; ++i) {
+		if ((cp->cp_pbdat & TPS2211_OC) == 0) {
+		    printk ("   *** Overcurrent - Safety shutdown ***\n");
+		    immap->im_ioport.iop_pcdat &= ~(TPS2211_VCCD0|TPS2211_VCCD1);
+		    return (1);
+		}
+		udelay (100);
+	}
+
+	DEBUG (3, "Enable PCMCIA buffers and stop RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg &= ~M8XX_PGCRX_CXRESET;	/* active high */
+	reg &= ~M8XX_PGCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+
+	udelay(250000);	/* some cards need >150 ms to come up :-( */
+
+	DEBUG (3, "# hardware_enable done\n");
+
+	return (0);
+}
+
+static int hardware_disable(int slot)
+{
+	volatile immap_t	*immap;
+	volatile pcmconf8xx_t	*pcmp;
+	u_long reg;
+
+	DEBUG (3, "hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+	immap = (immap_t *)IMAP_ADDR;
+	pcmp  = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia));
+
+	/* Configure PCMCIA General Control Register */
+	M8XX_PGCRX(_slot_) = 0;
+
+	DEBUG (3, "Disable PCMCIA buffers and assert RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg |= M8XX_PGCRX_CXRESET;	/* active high */
+	reg |= M8XX_PGCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+
+	/* ALl voltages off / Hi-Z */
+	immap->im_ioport.iop_pcdat |= (TPS2211_VPPD0 | TPS2211_VPPD1 |
+				       TPS2211_VCCD0 | TPS2211_VCCD1 );
+
+	udelay(10000);
+
+	return (0);
+}
+
+static int voltage_set(int slot, int vcc, int vpp)
+{
+	volatile immap_t	*immap;
+	volatile cpm8xx_t	*cp;
+	volatile pcmconf8xx_t	*pcmp;
+#if 0
+	u_long reg;
+#endif
+	ushort sreg;
+
+	DEBUG (3, "voltage_set: "	\
+		PCMCIA_BOARD_MSG	\
+		" Slot %c, Vcc=%d.%d, Vpp=%d.%d\n",
+		'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10);
+
+	immap = (immap_t *)IMAP_ADDR;
+	cp    = (cpm8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_cpm));
+	pcmp  = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia));
+#if 0
+	/*
+	 * Disable PCMCIA buffers (isolate the interface)
+	 * and assert RESET signal
+	 */
+	DEBUG (3, "Disable PCMCIA buffers and assert RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg |=  M8XX_PGCRX_CXRESET;	/* active high */
+	reg |=  M8XX_PGCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+	udelay(500);
+#endif
+	/*
+	 * Configure Port C pins for
+	 * 5 Volts Enable and 3 Volts enable,
+	 * Turn all power pins to Hi-Z
+	 */
+	DEBUG (3, "PCMCIA power OFF\n");
+	cfg_ports ();	/* Enables switch, but all in Hi-Z */
+
+	sreg  = immap->im_ioport.iop_pcdat;
+	sreg |= TPS2211_VPPD0 | TPS2211_VPPD1;		/* VAVPP always Hi-Z */
+
+	switch(vcc) {
+	case  0: 			break;	/* Switch off		*/
+	case 33: sreg |=  TPS2211_VCCD0;	/* Switch on 3.3V	*/
+		 sreg &= ~TPS2211_VCCD1;
+		 			break;
+	case 50: sreg &= ~TPS2211_VCCD0;	/* Switch on 5.0V	*/
+		 sreg |=  TPS2211_VCCD1;
+		 			break;
+	default: 			goto done;
+	}
+
+	/* Checking supported voltages */
+
+	DEBUG (3, "PIPR: 0x%x --> %s\n",
+		pcmp->pcmc_pipr,
+		(pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V");
+
+	immap->im_ioport.iop_pcdat = sreg;
+
+#ifdef DEBUG
+    {
+	char *s;
+
+	if ((sreg & TPS2211_VCCD0) && !(sreg & TPS2211_VCCD1)) {
+		s = "at 3.3V";
+	} else if (!(sreg & TPS2211_VCCD0) &&  (sreg & TPS2211_VCCD1)) {
+		s = "at 5.0V";
+	} else {
+		s = "down";
+	}
+	DEBUG (3, "PCMCIA powered %s\n", s);
+    }
+#endif
+
+done:
+#if 0
+	DEBUG (3, "Enable PCMCIA buffers and stop RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg &= ~M8XX_PGCRX_CXRESET;	/* active high */
+	reg &= ~M8XX_PGCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+#endif
+	udelay(500);
+
+	DEBUG (3, "voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n",
+		slot+'A');
+	return (0);
+}
+
+static void cfg_ports()
+{
+	volatile immap_t	*immap;
+	volatile cpm8xx_t	*cp;
+	ushort sreg;
+
+	immap = (immap_t *)IMAP_ADDR;
+	cp    = (cpm8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_cpm));
+
+	/*
+	 * Configure Port C for TPS2211 PC-Card Power-Interface Switch
+	 *
+	 * Switch off all voltages, assert shutdown
+	 */
+	sreg = immap->im_ioport.iop_pcdat;
+	sreg |=  (TPS2211_VPPD0 | TPS2211_VPPD1);	/* VAVPP => Hi-Z */
+	sreg &= ~(TPS2211_VCCD0 | TPS2211_VCCD1);	/* 3V and 5V off */
+	immap->im_ioport.iop_pcdat = sreg;
+
+	immap->im_ioport.iop_pcpar &= ~(TPS2211_OUTPUTS);
+	immap->im_ioport.iop_pcdir |=   TPS2211_OUTPUTS;
+
+	DEBUG (3, "Set Port C: PAR:     %04x DIR:     %04x DAT:     %04x\n",
+		immap->im_ioport.iop_pcpar,
+		immap->im_ioport.iop_pcdir,
+		immap->im_ioport.iop_pcdat);
+
+	/*
+	 * Configure Port B for TPS2211 PC-Card Power-Interface Switch
+	 *
+	 * Over-Current Input only
+	 */
+	cp->cp_pbpar &= ~(TPS2211_INPUTS);
+	cp->cp_pbdir &= ~(TPS2211_INPUTS);
+
+	DEBUG (3, "Set Port B: PAR: %08x DIR: %08x DAT: %08x\n",
+		cp->cp_pbpar, cp->cp_pbdir, cp->cp_pbdat);
+}
+
+#define socket_get(_slot_) PCMCIA_SOCKET_KEY_LV
+
+#endif /* CONFIG_C2MON */
+
+
+/* ---------------------------------------------------------------------------- */
+/* ICU862 Boards by Cambridge Broadband Ltd.					*/
+/* ---------------------------------------------------------------------------- */
+
+#if defined(CONFIG_ICU862)
+
+/*-----------------------------------------------------------------------
+ * PCMCIA Power Switch
+ *
+ * The ICU862 uses a TPS2205 PC-Card Power-Interface Switch to
+ * control the voltages on the PCMCIA slot which is connected to Port B
+ *-----------------------------------------------------------------------
+ */
+
+/* PORT B */
+			/* Output pins */
+#define TPS2205_VCC5	0x00020000	/* PB.14:  5V Voltage Control	*/
+#define TPS2205_VCC3	0x00000001	/* PB.31:  3V Voltage Control	*/
+#define TPS2205_SHDN	0x00000200	/* PB.22: Shutdown		*/
+#define TPS2205_PORTB_OUTPUTS ( TPS2205_VCC5    | TPS2205_VCC3    | \
+			  TPS2205_SHDN)
+
+			/* Input pins */
+#define TPS2205_OC	0x00000100	/* PB.23: Over-Current		*/
+#define TPS2205_PORTB_INPUTS	( TPS2205_OC )
+
+/* PORT C */
+			/* Output pins */
+#define TPS2205_VPP_PGM	0x0020	/* PC.10: PGM Voltage Control	*/
+#define TPS2205_VPP_VCC	0x0010	/* PC.11: VPP Voltage Control	*/
+#define TPS2205_PORTC_OUTPUTS ( TPS2205_VPP_PGM  | TPS2205_VPP_VCC )
+
+			/* Input pins */
+#define TPS2205_PORTC_INPUTS	( 0 )
+
+#define SIUMCR_DBGC11	0x00600000	/* Debug pins configuration */
+
+#define PCMCIA_BOARD_MSG "ICU862"
+
+static void cfg_port_B (void);
+static void cfg_port_C (void);
+
+static int hardware_enable(int slot)
+{
+	volatile immap_t	*immap;
+	volatile sysconf8xx_t	*sysp;
+	volatile cpm8xx_t	*cp;
+	volatile pcmconf8xx_t	*pcmp;
+    uint pipr, mask;
+	uint reg;
+    ushort shortreg;
+	int i;
+
+	DEBUG (3,"hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+	udelay(10000);
+
+	immap = (immap_t *)IMAP_ADDR;
+	sysp  = (sysconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_siu_conf));
+	pcmp  = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia));
+	cp    = (cpm8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_cpm));
+
+
+	/* Configure Port B for TPS2205 PC-Card Power-Interface Switch */
+	cfg_port_B ();
+
+	/* Configure Port C for TPS2205 PC-Card Power-Interface Switch */
+	cfg_port_C ();
+
+	/*
+	 * Configure SIUMCR to enable PCMCIA port B
+	 * (VFLS[0:1] are not used for debugging, we connect FRZ# instead)
+	 */
+	sysp->sc_siumcr &= ~SIUMCR_DBGC11;	/* set DBGC to 00 */
+
+	/* clear interrupt state, and disable interrupts */
+	pcmp->pcmc_pscr =  M8XX_PCMCIA_MASK(_slot_);
+	pcmp->pcmc_per &= ~M8XX_PCMCIA_MASK(_slot_);
+
+	/* disable interrupts & DMA */
+	M8XX_PGCRX(_slot_) = 0;
+
+	/*
+	 * Disable PCMCIA buffers (isolate the interface)
+	 * and assert RESET signal
+	 */
+	DEBUG (3,"Disable PCMCIA buffers and assert RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg |=  M8XX_PGCRX_CXRESET;	/* active high */
+	reg |=  M8XX_PGCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+	udelay(500);
+
+	/*
+	 * Make sure there is a card in the slot, then configure the interface.
+	 */
+	udelay(10000);
+	DEBUG (3, "[%d] %s: PIPR(%p)=0x%x\n",
+		__LINE__,__FUNCTION__,
+		&(pcmp->pcmc_pipr),pcmp->pcmc_pipr);
+	if (pcmp->pcmc_pipr & 0x00001800) {
+		printk (KERN_INFO "   No Card found\n");
+		return (1);
+	}
+
+	/*
+	 * Power On: Set VAVCC to 3.3V or 5V, set VAVPP to Hi-Z
+	 */
+	mask = M8XX_PCMCIA_VS1(slot) | M8XX_PCMCIA_VS2(slot);
+	pipr = pcmp->pcmc_pipr;
+	DEBUG (3, "PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n",
+		pipr,
+		(pipr&M8XX_PCMCIA_VS1(slot))?"n":"ff",
+		(pipr&M8XX_PCMCIA_VS2(slot))?"n":"ff");
+
+    reg = cp->cp_pbdat;
+	shortreg  = immap->im_ioport.iop_pcdat;
+	if ((pipr & mask) == mask) {
+		shortreg |=  (TPS2205_VPP_PGM | TPS2205_VPP_VCC);	/* VAVPP => Hi-Z */
+		reg |=	 TPS2205_VCC3;				/* 3V off	*/
+		reg &= ~(TPS2205_VCC5);				/* 5V on	*/
+		printk (KERN_INFO " 5.0V card found: \n");
+	} else {
+		shortreg |=  (TPS2205_VPP_PGM | TPS2205_VPP_VCC);	/* VAVPP => Hi-Z */
+		reg |=   TPS2205_VCC5;				/* 5V off	*/
+		reg &= ~(TPS2205_VCC3);				/* 3V on	*/
+		printk (KERN_INFO " 3.3V card found: ");
+	}
+
+	DEBUG (3, "\nPB DAT: %08x -> 3.3V %s 5.0V %s VPP_PGM %s VPP_VCC %s\n",
+		reg,
+		(reg & TPS2205_VCC3)    ? "off" : "on",
+		(reg & TPS2205_VCC5)    ? "off" : "on",
+		(shortreg & TPS2205_VPP_PGM) ? "off" : "on", 
+		(shortreg & TPS2205_VPP_VCC) ? "off" : "on" );
+
+    immap->im_ioport.iop_pcdat = shortreg;
+	cp->cp_pbdat = reg;
+
+	/*  Wait 500 ms; use this to check for over-current */
+	for (i=0; i<5000; ++i) {
+		if ((cp->cp_pbdat & TPS2205_OC) == 0) {
+			printk (KERN_INFO "   *** Overcurrent - Safety shutdown ***\n");
+			cp->cp_pbdat &= ~(TPS2205_SHDN);
+			return (1);
+		}
+		udelay (100);
+	}
+
+	DEBUG (3, "Enable PCMCIA buffers and stop RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg &= ~M8XX_PGCRX_CXRESET;	/* active high */
+	reg &= ~M8XX_PGCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+
+	udelay(250000);	/* some cards need >150 ms to come up :-( */
+
+	DEBUG (3, "# hardware_enable done\n");
+
+	return (0);
+}
+
+static int hardware_disable(int slot)
+{
+	volatile cpm8xx_t	*cp;
+	volatile immap_t	*immap;
+	u_long reg;
+
+	DEBUG (3,"hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+	immap = (immap_t *)IMAP_ADDR;
+
+	cp    = (cpm8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_cpm));
+
+	/* Shut down */
+	cp->cp_pbdat &= ~(TPS2205_SHDN);
+	/* Configure PCMCIA General Control Register */
+	M8XX_PGCRX(_slot_) = 0;
+
+	DEBUG (3,"Disable PCMCIA buffers and assert RESET\n");
+	reg  =  M8XX_PGCRX(_slot_);
+	reg |= M8XX_PGCRX_CXRESET;	/* active high */
+	reg |= M8XX_PGCRX_CXOE;		/* active low  */
+	M8XX_PGCRX(_slot_) = reg;
+
+	udelay(10000);
+	return (0);
+}
+
+static int voltage_set(int slot, int vcc, int vpp)
+{
+	volatile immap_t	*immap;
+	volatile cpm8xx_t	*cp;
+	u_long reg;
+
+	DEBUG (3,"voltage_set: "	\
+		PCMCIA_BOARD_MSG	\
+		" Slot %c, Vcc=%d.%d, Vpp=%d.%d\n",
+		'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10);
+
+	immap = (immap_t *)IMAP_ADDR;
+	cp    = (cpm8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_cpm));
+
+	/*
+	 * Configure Port C pins for
+	 * 5 Volts Enable and 3 Volts enable,
+	 * Turn all power pins to Hi-Z
+	 */
+	DEBUG (3,"PCMCIA power OFF\n");
+	cfg_port_B ();	/* Enables switch, but all in Hi-Z */
+
+	reg  = cp->cp_pbdat;
+
+	switch(vcc) {
+	case  0: 			break;	/* Switch off		*/
+	case 33: reg &= ~TPS2205_VCC3;	break;	/* Switch on 3.3V	*/
+	case 50: reg &= ~TPS2205_VCC5;	break;	/* Switch on 5.0V	*/
+	default: 			goto done;
+	}
+
+	/* Checking supported voltages */
+
+	DEBUG (3,"PIPR: 0x%x --> %s\n",
+		pcmp->pcmc_pipr,
+		(pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V");
+
+	cp->cp_pbdat = reg;
+
+#ifdef DEBUG
+    {
+	char *s;
+
+	if ((reg & TPS2205_VCC3) == 0) {
+		s = "at 3.3V";
+	} else if ((reg & TPS2205_VCC5) == 0) {
+		s = "at 5.0V";
+	} else {
+		s = "down";
+	}
+	printk (KERN_INFO "PCMCIA powered %s\n", s);
+    }
+#endif
+done:
+	return (0);
+}
+
+static void cfg_port_B (void)
+{
+	volatile immap_t	*immap;
+	volatile cpm8xx_t	*cp;
+	uint reg;
+
+	immap = (immap_t *)IMAP_ADDR;
+	cp    = (cpm8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_cpm));
+
+	/*
+	 * Configure Port B for TPS2205 PC-Card Power-Interface Switch
+	 *
+	 * Switch off all voltages, assert shutdown
+	 */
+	reg  = cp->cp_pbdat;
+	reg |=  ( TPS2205_VCC3    | TPS2205_VCC5    |	/* VAVCC => Hi-Z */
+              TPS2205_SHDN);				/* enable switch */
+	cp->cp_pbdat = reg;
+
+	cp->cp_pbpar &= ~(TPS2205_PORTB_INPUTS | TPS2205_PORTB_OUTPUTS);
+
+	reg = cp->cp_pbdir & ~(TPS2205_PORTB_INPUTS);
+	cp->cp_pbdir = reg | TPS2205_PORTB_OUTPUTS;
+
+	DEBUG (3,"Set Port B: PAR: %08x DIR: %08x DAT: %08x\n",
+		cp->cp_pbpar, cp->cp_pbdir, cp->cp_pbdat);
+}
+
+static void cfg_port_C (void)
+{
+	volatile immap_t	*immap;
+	ushort shortreg;
+
+	immap = (immap_t *)IMAP_ADDR;
+
+	/*
+	 * Configure Port C for TPS2205 PC-Card Power-Interface Switch
+	 *
+	 * Switch off all voltages
+	 */
+	shortreg  = immap->im_ioport.iop_pcdat;
+	shortreg |=  (TPS2205_VPP_PGM | TPS2205_VPP_VCC );	/* VAVPP => Hi-Z */
+	immap->im_ioport.iop_pcdat = shortreg;
+
+    immap->im_ioport.iop_pcpar &= ~(TPS2205_PORTC_INPUTS | TPS2205_PORTC_OUTPUTS);
+    immap->im_ioport.iop_pcso  &= ~(TPS2205_PORTC_INPUTS | TPS2205_PORTC_OUTPUTS);
+
+    shortreg = immap->im_ioport.iop_pcdir & ~(TPS2205_PORTC_INPUTS);
+    immap->im_ioport.iop_pcdir = shortreg | TPS2205_PORTC_OUTPUTS;
+
+	DEBUG (3,"Set Port C: PAR: %04x DIR: %04x DAT: %04x\n",
+                  immap->im_ioport.iop_pcpar, immap->im_ioport.iop_pcdir, immap->im_ioport.iop_pcdat);
+}
+
+#define socket_get(_slot_) PCMCIA_SOCKET_KEY_LV
+
+#endif	/* ICU862 */
+
+
 /* RPX Boards from Embedded Planet                                           */
 
 #if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE)
@@ -917,6 +1771,27 @@ static int m8xx_set_socket(u_short lsock
 		e++;
 	}
 
+	/*
+	 * If io_irq is non-zero we should enable irq.
+	 */
+
+	if(state->io_irq) {
+		M8XX_PGCRX(_slot_) |= 
+			mk_int_int_mask(state->io_irq) << 24;
+		/*
+		 * Strange thing here:
+		 * The manual does not tell us which interrupt
+		 * the sources generate.
+		 * Anyhow, I found out that RDY_L generates IREQLVL.
+		 *
+		 * We use level triggerd interrupts, and they don't
+		 * have to be cleared in PSCR in the interrupt handler.
+		 */
+		reg |= M8XX_PCMCIA_RDY_L(_slot_);  
+	}
+	else
+		M8XX_PGCRX(_slot_) &= 0x00ffffff;
+
 	if(state->flags & SS_IOCARD) {
 
 		/* 
@@ -928,31 +1803,7 @@ static int m8xx_set_socket(u_short lsock
 			reg |= e->regbit = M8XX_PCMCIA_BVD1(_slot_);
 			e++;
 		}
-		
-
-		/*
-		 * If io_irq is non-zero we should enable irq.
-		 */
-
-		if(state->io_irq) {
-			M8XX_PGCRX(_slot_) |= 
-				mk_int_int_mask(state->io_irq) << 24;
-
-			/*
-			 * Strange thing here:
-			 * The manual does not tell us which interrupt
-			 * the sources generate.
-			 * Anyhow, I found out that RDY_L generates IREQLVL.
-			 *
-			 * We use level triggerd interrupts, and they don't
-			 * have to be cleared in PSCR in the interrupt handler.
-			 */
-
-			reg |= M8XX_PCMCIA_RDY_L(_slot_);  
-		}
-		else
-			M8XX_PGCRX(_slot_) &= 0x00ffffff;
-		
+				
 #if 0
 		if(state->flags & SS_SPKR_ENA)
 			enablespeaker();
diff -purN pcmcia-cs-3.2.0.orig/wireless/Makefile pcmcia-cs-3.2.0/wireless/Makefile
--- pcmcia-cs-3.2.0.orig/wireless/Makefile	Mon Aug 27 05:14:13 2001
+++ pcmcia-cs-3.2.0/wireless/Makefile	Mon Sep 30 13:28:00 2002
@@ -18,10 +18,10 @@ MODULES = netwave_cs.o wavelan_cs.o ray_
 SRCS    = netwave_cs.c wavelan_cs.c ray_cs.c airo_cs.c airo.c \
 	  wvlan_cs.c wvlan_hcf.c wvlan_hcfio.c
 
-ifdef DO_ORINOCO
+#ifdef DO_ORINOCO
 MODULES += hermes.o orinoco.o orinoco_cs.o
 SRCS    += hermes.c orinoco.c orinoco_cs.c
-endif
+#endif
 
 all:	$(MODULES)
 
diff -purN pcmcia-cs-3.2.0.orig/wireless/orinoco.c pcmcia-cs-3.2.0/wireless/orinoco.c
--- pcmcia-cs-3.2.0.orig/wireless/orinoco.c	Thu Jul  4 06:06:07 2002
+++ pcmcia-cs-3.2.0/wireless/orinoco.c	Mon Sep 30 13:28:00 2002
@@ -624,15 +624,34 @@ orinoco_reset(struct orinoco_private *pr
 	struct hermes_idstring idbuf;
 
 	TRACE_ENTER(priv->ndev->name);
+#if 0
+	/* The lock placed here causes the BUG() to be called
+	   on the ppc from the kmem_cache_grow() at slab.c:1073:
+	   ...
+	   if (in_interrupt() && (flags & SLAB_LEVEL_MASK) != SLAB_ATOMIC)
+	       BUG();
+	   ...
+
+	   The event sequence is following:
+	   priv->hard_reset(), ioremap(),
+	   get_vm_area(), kmalloc(), kmem_cache_grow().
+	   Placing the locking later in code does not affect
+	   the data safeness.
+	*/
 
 	/* Stop other people bothering us */
 	orinoco_lock(priv);
+#endif
 	__orinoco_stop_irqs(priv);
 
 	/* Check if we need a card reset */
 	if (priv->hard_reset)
 		priv->hard_reset(priv);
 
+#if 1
+	/* Stop other people bothering us */
+	orinoco_lock(priv);
+#endif
 	/* Do standard firmware reset if we can */
 	err = hermes_reset(hw);
 	if (err)
--- pcmcia-cs-3.2.1.orig/clients/ide-cs.c	Thu Aug 15 19:42:41 2002
+++ pcmcia-cs-3.2.1/clients/ide-cs.c	Thu Oct  3 16:40:20 2002
@@ -250,7 +250,8 @@
     cistpl_cftable_entry_t *cfg = &parse.cftable_entry;
     cistpl_cftable_entry_t dflt = { 0 };
     int i, pass, last_ret, last_fn, hd, io_base, ctl_base, is_kme = 0;
-
+    int is_argosy = 0;
+    
     DEBUG(0, "ide_config(0x%p)\n", link);
     
     tuple.TupleData = (cisdata_t *)buf;
@@ -266,10 +267,13 @@
     tuple.DesiredTuple = CISTPL_MANFID;
     if (!CardServices(GetFirstTuple, handle, &tuple) &&
 	!CardServices(GetTupleData, handle, &tuple) &&
-	!CardServices(ParseTuple, handle, &tuple, &parse))
+	!CardServices(ParseTuple, handle, &tuple, &parse)) {
 	is_kme = ((parse.manfid.manf == MANFID_KME) &&
 		  ((parse.manfid.card == PRODID_KME_KXLC005_A) ||
 		   (parse.manfid.card == PRODID_KME_KXLC005_B)));
+	is_argosy = ((parse.manfid.manf == MANFID_ARGOSY) &&
+		      (parse.manfid.card == PRODID_ARGOSY_D5));
+    }
 
     /* Configure card */
     link->state |= DEV_CONFIG;
@@ -312,9 +316,15 @@
 	    if (!(io->flags & CISTPL_IO_16BIT))
 		link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
 	    if (io->nwin == 2) {
-		link->io.NumPorts1 = 8;
-		link->io.BasePort2 = io->win[1].base;
-		link->io.NumPorts2 = (is_kme) ? 2 : 1;
+		if (is_argosy) {
+			link->io.NumPorts1 = 2;
+			link->io.BasePort2 = io->win[1].base;
+			link->io.NumPorts2 = 8;
+		} else {
+			link->io.NumPorts1 = 8;
+			link->io.BasePort2 = io->win[1].base;
+			link->io.NumPorts2 = (is_kme) ? 2 : 1;
+		}
 		CFG_CHECK(RequestIO, link->handle, &link->io);
 		io_base = link->io.BasePort1;
 		ctl_base = link->io.BasePort2;
