diff -urN kernel26/arch/arm/mach-pxa/h4000_pcmcia.c kernel26_h4000/arch/arm/mach-pxa/h4000_pcmcia.c
--- kernel26/arch/arm/mach-pxa/h4000_pcmcia.c	1970-01-01 01:00:00.000000000 +0100
+++ kernel26_h4000/arch/arm/mach-pxa/h4000_pcmcia.c	2004-06-02 22:11:00.000000000 +0200
@@ -0,0 +1,212 @@
+/*
+ * arch/arm/mach-pxa/h4000_pcmcia.c
+ *
+ * PCMCIA implementation routines for Toshiba e-series PDAs
+ *
+ * (c) 2003 Ian Molton (spyro@f2s.com)
+ *
+ * 21-04-2004: E De Pieri: Adapted from toshiba exxx to h4000. 
+ *			   At the moment it just crash linux.
+ *                         To build successfully it needs latest h4000.c
+ *			   (with platform_device structure)
+ *	      		   This module should be necessary to get wlan working.
+ *			   Perhaps with this we could use cardctl info to make
+ *			   linux crash in a new funny way :D.
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+#include <linux/init.h>
+
+#include <asm/hardware.h>
+#include <asm/mach-types.h>
+#include <asm/irq.h>
+#include <asm/signal.h>
+
+#include <asm/arch/pcmcia.h>
+#include <asm/arch/h4000-gpio.h>
+
+struct h4000_pcmcia {
+	int nr;
+	int cd0;
+	int cd1;
+	int irq0;
+	int irq1;
+	int rst0;
+	int rst1;
+	int pwr;
+};
+
+static struct h4000_pcmcia h4000_pcmcia_info = {
+	.nr   = 1,
+//	.cd0  = GPIO_E800_PCMCIA_CD0,
+//	.cd1  = GPIO_E800_PCMCIA_CD1,
+//	.irq0 = GPIO_E800_PCMCIA_RDY0,
+//	.irq1 = GPIO_E800_PCMCIA_RDY1,
+//	.pwr  = GPIO_E800_PCMCIA_VS_3V
+	.cd0  = 1,
+	.cd1  = 1,
+	.irq0 = 11, //I suspect gpio wifi
+//	.irq1 = 1,
+	.pwr  = 1,
+};
+
+static struct h4000_pcmcia *pcmcia_info;
+
+static int h4000_pcmcia_hw_init(struct pxa2xx_pcmcia_socket *skt)
+{
+	switch(skt->nr){
+		case 0:	/* Compactflash slot */
+			skt->irq = IRQ_GPIO(pcmcia_info->irq0);
+		break;
+		case 1: /* WiFi adapter */
+        		skt->irq = IRQ_GPIO(pcmcia_info->irq1);
+		break;
+	}
+        return 0;
+}
+
+
+/*
+ * Release all resources.
+ */
+static void h4000_pcmcia_hw_shutdown(struct pxa2xx_pcmcia_socket *skt)
+{
+}
+
+static void
+h4000_pcmcia_socket_state(struct pxa2xx_pcmcia_socket *skt, struct pcmcia_state *state)
+{
+//	unsigned long gplr0 = GPLR0;   FIXME - this really ought to be atomic
+//	unsigned long gplr1 = GPLR1;
+
+	/* This stuff probably ought to be done with IRQs off... */
+	//GPSR(RA_ALPHA_GPIO_CF_RST) |= RA_ALPHA_GPIO_CF_RST;
+
+	switch(skt->nr) {
+		case 0: /* Compactflash slot */
+			state->detect = (GPLR(pcmcia_info->cd0)  & GPIO_bit(pcmcia_info->cd0)) ? 0 : 1;
+			state->ready  = (GPLR(pcmcia_info->irq0) & GPIO_bit(pcmcia_info->irq0)) ? 1 : 0;
+			state->vs_3v  = 1; //FIXME - is it right?
+		break;
+		case 1: /* WiFi adapter */
+			state->detect = (GPLR(pcmcia_info->cd1)  & GPIO_bit(pcmcia_info->cd1)) ? 0 : 1;
+			state->ready  = (GPLR(pcmcia_info->irq1) & GPIO_bit(pcmcia_info->irq1)) ? 1 : 0;
+			state->vs_3v  = 1; /* Can only apply 3.3V? */
+		break;
+	}
+
+// EVIL e800 hack FIXME
+	if(machine_is_h4000()) {
+		state->ready  = 1;
+		state->detect = 1;
+	}
+// END evil hack
+	state->bvd1   = 1;
+	state->bvd2   = 1;
+	state->wrprot = 0;
+	state->vs_Xv  = 0;
+}
+
+static int
+h4000_pcmcia_configure_socket(struct pxa2xx_pcmcia_socket *skt, const socket_state_t *state)
+{
+	if(machine_is_h4000())
+		return 0; // FIXME EVIL e800 hack
+
+	if(skt->nr == 0) {
+		/* reset it? */
+		if(state->flags & SS_RESET)
+			GPSR(pcmcia_info->rst0) = GPIO_bit(pcmcia_info->rst0);
+		else
+			GPCR(pcmcia_info->rst0) = GPIO_bit(pcmcia_info->rst0);
+
+		/* Apply socket voltage */
+	        switch (state->Vcc) {
+        	case 0:
+			GPCR(pcmcia_info->pwr) = GPIO_bit(pcmcia_info->pwr);
+                break;
+	        case 50:
+		case 33:
+                /* Apply power to socket */
+			GPSR(pcmcia_info->pwr) = GPIO_bit(pcmcia_info->pwr);
+		break;
+		default:
+			printk (KERN_ERR "%s: Unsupported Vcc:%d\n", __FUNCTION__, state->Vcc);
+        	}
+	}
+	else {
+		printk(KERN_ERR "Cant configure socket 1\n");
+	}
+
+	return 0;
+}
+
+/*
+ * Enable card status IRQs on (re-)initialisation.  This can
+ * be called at initialisation, power management event, or
+ * pcmcia event.
+ */
+static void h4000_pcmcia_socket_init(struct pxa2xx_pcmcia_socket *skt)
+{
+//FIXME - should enable the bus here ?
+}
+
+/*
+ * Disable card status IRQs on suspend.
+ */
+static void h4000_pcmcia_socket_suspend(struct pxa2xx_pcmcia_socket *skt)
+{
+}
+
+static struct pcmcia_irqs irqs[] = {
+	{ 0, IRQ_GPIO(11), "PCMCIA CD0" }, // wifi?
+//	{ 0, IRQ_GPIO(5), "PCMCIA CD1" }  //FIXME
+};
+                                                                                
+static struct pcmcia_low_level h4000_pcmcia_ops = { 
+	.owner			= THIS_MODULE,
+	
+	.nr			= 2,    //FIXME
+	.first			= 0,
+	.cd_irq			= irqs,
+
+	.hw_init		= h4000_pcmcia_hw_init,
+	.hw_shutdown		= h4000_pcmcia_hw_shutdown,
+
+	.socket_state		= h4000_pcmcia_socket_state,
+	.configure_socket	= h4000_pcmcia_configure_socket,
+
+	.socket_init		= h4000_pcmcia_socket_init,
+	.socket_suspend		= h4000_pcmcia_socket_suspend,
+};
+
+static struct platform_device h4000_pcmcia_device = {
+        .name           = "pxa2xx-pcmcia",
+        .id             = 0,
+        .dev            = {
+                .platform_data  = &h4000_pcmcia_ops,
+        }
+};
+
+static int __init h4000_pcmcia_init(void)
+{
+	if(machine_is_h4000())
+		pcmcia_info = &h4000_pcmcia_info;
+	else
+		return -ENODEV;
+
+	//h4000_pcmcia_ops.nr = pcmcia_info->nr;
+
+	return platform_add_device(&h4000_pcmcia_device);
+}
+
+static void __exit h4000_pcmcia_exit(void)
+{
+        platform_remove_device (&h4000_pcmcia_device);
+}
+
+module_init(h4000_pcmcia_init);
+module_exit(h4000_pcmcia_exit);
diff -urN kernel26/arch/arm/mach-pxa/Makefile kernel26_h4000/arch/arm/mach-pxa/Makefile
--- kernel26/arch/arm/mach-pxa/Makefile	2004-05-22 20:51:29.000000000 +0200
+++ kernel26_h4000/arch/arm/mach-pxa/Makefile	2004-06-02 22:12:00.000000000 +0200
@@ -21,6 +21,7 @@
 obj-$(CONFIG_ARCH_H1900)	+= h1900.o
 obj-$(CONFIG_ARCH_H3900)	+= h3900.o
 obj-$(CONFIG_MACH_H4000)        += h4000.o
+obj-$(CONFIG_H4000_PCMCIA) 	+= h4000_pcmcia.o
 obj-$(CONFIG_ARCH_H5400)	+= h5400.o
 obj-$(CONFIG_ARCH_H2200)	+= h2200.o
 obj-$(CONFIG_H2200_BATTERY)	+= h2200_battery.o
diff -urN kernel26/arch/arm/mach-pxa/Makefile kernel26_h4000/arch/arm/mach-pxa/Makefile
--- kernel26/arch/arm/mach-pxa/Kconfig	2004-05-22 20:51:29.000000000 +0200
+++ kernel26_h4000/arch/arm/mach-pxa/Kconfig	2004-06-02 22:12:00.000000000 +0200
@@ -51,6 +51,14 @@
         bool "hp iPAQ h4000"
         depends on ARCH_PXA
 
+config H4000_PCMCIA
+	tristate "iPAQ H4000 PCMCIA"
+	depends on MACH_H4000
+	help
+	  This enables support for using PCMCIA (Integrated wi-fi) cards
+	  on iPAQ 4000. You will also need to enable PXA2xx PCMCIA
+	  support in the PCMCIA/Cardbus support menu.
+
 config ARCH_H5400
 	bool "hp iPAQ h5100/h5400/h5500"
 	depends on ARCH_PXA
