[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-tech
Subject:    multi function pcmcia cards: please test
From:       "Federico G. Schwindt" <fgsch () lodoss ! net>
Date:       2006-01-29 20:14:51
Message-ID: 20060129201451.GF9607 () lodoss ! net
[Download RAW message or body]

Hi,

  the following diff fixes some multi function cards that otherwise configure
but does not work correctly (ie. the wd part of the sandisk wifi + 128m CF).
  if you have any of these (usually net + modem) give it a try and send me
the report privately, along with dmesg.
  thanks.

  f.-

Index: sys/dev/pcmcia/pcmcia.c
===================================================================
RCS file: /cvs/src/sys/dev/pcmcia/pcmcia.c,v
retrieving revision 1.35
diff -u -p -r1.35 pcmcia.c
--- sys/dev/pcmcia/pcmcia.c	5 Aug 2005 18:21:04 -0000	1.35
+++ sys/dev/pcmcia/pcmcia.c	18 Jan 2006 03:19:58 -0000
@@ -492,8 +492,9 @@ pcmcia_function_enable(pf)
 	reg = (pf->cfe->number & PCMCIA_CCR_OPTION_CFINDEX);
 	reg |= PCMCIA_CCR_OPTION_LEVIREQ;
 	if (pcmcia_mfc(pf->sc)) {
-		reg |= (PCMCIA_CCR_OPTION_FUNC_ENABLE |
-			PCMCIA_CCR_OPTION_ADDR_DECODE);
+		reg |= PCMCIA_CCR_OPTION_FUNC_ENABLE;
+		if (pf->ccr_mask & (1 << (PCMCIA_CCR_IOBASE0 / 2)))
+			reg |= PCMCIA_CCR_OPTION_ADDR_DECODE;
 		if (pf->ih_fct)
 			reg |= PCMCIA_CCR_OPTION_IREQ_ENABLE;
 
@@ -637,7 +638,8 @@ pcmcia_io_map(pf, width, offset, size, p
 	 * don't overlap, and that the ccr's are set correctly.
 	 */
 
-	if (pcmcia_mfc(pf->sc)) {
+	if (pcmcia_mfc(pf->sc) &&
+	    (pf->ccr_mask & (1 << (PCMCIA_CCR_IOBASE0 / 2)))) {
 		bus_addr_t iobase = pcihp->addr;
 		bus_addr_t iomax = pcihp->addr + pcihp->size - 1;

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic