*** sys/dev/ata/ata-card.c.orig	Mon Mar 18 17:37:33 2002
--- sys/dev/ata/ata-card.c	Fri May  3 13:10:34 2002
***************
*** 44,55 ****
--- 44,58 ----
  #include <sys/rman.h>
  #include <dev/ata/ata-all.h>
  
+ #define KME_IO 0x1
+ 
  static int
  ata_pccard_probe(device_t dev)
  {
      struct ata_channel *ch = device_get_softc(dev);
      struct resource *io;
      int rid, len, start, end;
+     int flags = device_get_flags(dev);
      u_long tmp;
  
      /* allocate the io range to get start and length */
***************
*** 82,87 ****
--- 85,101 ----
  	    bus_set_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID, 
  			     start + ATA_ALTOFFSET, ATA_ALTIOSIZE);
  	}
+         if (flags & KME_IO) {
+ 	    rid = ATA_ALTADDR_RID;
+ 	    io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
+ 				    0, ~0, ATA_ALTIOSIZE + 1, RF_ACTIVE);
+ 	    if (io) {
+ 		bus_space_write_1(rman_get_bustag(io), 
+ 				  rman_get_bushandle(io), 1, 0x81);
+  		bus_release_resource(dev, SYS_RES_IOPORT, rid, io);
+ 	    }
+ 	}
+ 
      }
      else
  	return ENOMEM;
