Subject: Re: kern/31245: Adaptec 1460 pcmcia support (aic) broken
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <djb_netbsd@charter.net>
List: netbsd-bugs
Date: 08/21/2007 19:05:10
The following reply was made to PR kern/31245; it has been noted by GNATS.

From: <djb_netbsd@charter.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/31245: Adaptec 1460 pcmcia support (aic) broken
Date: Tue, 21 Aug 2007 15:03:40 -0400

 diff for 4.99.19
 
 =================================
 
 --- dev/pcmcia/pcmcia.c.orig	2007-08-20 21:21:27.000000000 -0500
 +++ dev/pcmcia/pcmcia.c	2007-08-21 08:58:45.000000000 -0500
 @@ -778,16 +778,18 @@
  	for (n = 0; n < cfe->num_iospace; n++) {
  		bus_addr_t start = cfe->iospace[n].start;
  		bus_size_t length = cfe->iospace[n].length;
 -		bus_size_t align = cfe->iomask ? (1 << cfe->iomask) :
 -		    length;
 -		bus_size_t skew = start & (align - 1);
 -
 +		bus_size_t align = (cfe->iomask ? (1 << cfe->iomask) :
 +		    length) & 0x3ff;
 +		bus_size_t skew; 
 +/* DJB split skew to make gcc happy */
 +		skew = start & (align - 1);
 +/* DJB
  		if ((start - skew) == 0 && align < 0x400) {
  			if (skew)
  				printf("Drats!  I need a skew!\n");
  			start = 0;
  		}
 -
 +*/
  		DPRINTF(("pcmcia_config_alloc: io %d start=%lx length=%lx align=%lx skew=%lx\n",
  		    n, (long)start, (long)length, (long)align, (long)skew));