NetBSD Problem Report #14741

Received: (qmail 3542 invoked from network); 26 Nov 2001 17:41:10 -0000
Message-Id: <200111261740.fAQHefU00631@kame.naobsd.org>
Date: Tue, 27 Nov 2001 02:40:41 +0900 (JST)
From: naoki@fukaumi.org
Reply-To: naoki@fukaumi.org
To: gnats-bugs@gnats.netbsd.org
Subject: pcmcia_io_alloc and bad start io address PCMCIA devices
X-Send-Pr-Version: 3.95

>Number:         14741
>Category:       kern
>Synopsis:       pcmcia_io_alloc and bad start io address PCMCIA devices
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 26 17:42:00 +0000 2001
>Closed-Date:    
>Last-Modified:  
>Originator:     
>Release:        NetBSD 1.5Y (2001/11/21)
>Organization:
FUKAUMI Naoki
>Environment:
	CardBus bridge PCI card (RICOH R5C475II) on i386
>Description:
	My wi device attach failed on i386. It succeeded on hpcmips.
	Also, wd at wdc at pcmcia device (SmartMedia Card Adapter) couldn't
	attach.
	Other PCMCIA device (ne, com) has no problem on same machine.

	wi fail message is "wi0: could not get mac address, attach failed".
	Some people report same message on some mailing-list and PR.
	(e.g. port-i386, or PR kern/11108)

	I found
	dmesg of BAD device:
	    pcmcia0: (snip) iospace 0-3f; io16 irqshare irqpulse irqlevel
                                    ^^^^
	    pccbb_pcmcia_do_io_map win 0 addr 0x4000 size 0x40 width 0
	                                        ^^^^
	iopace start from 0 (zero) and io_map to addr 0x4000.

	ne and com device start from 3xx and io_map addr is 0x43xx.

	I do quick hack attached this mail. Patched kernel works fine.

	dmesg is:
	  :
	pcmcia0: CIS version PC Card Standard 5.0
	pcmcia0: CIS info: BUFFALO, WLI-CF-S11G, , 
	pcmcia0: Manufacturer code 0x26f, product 0x30b
	pcmcia0: function 0: network adapter, ccr addr 3e0 mask 1
	pcmcia0: function 0, config table entry 1: I/O card; irq mask ffff; iomask 6, iospace 0-3f; io16 irqshare irqpulse irqlevel
	wi0 at pcmcia0 function 0: BUFFALO, WLI-CF-S11G, 
	wi0:pccbb_pcmcia_io_map window 0 dynamic port 4500+40
	cbb0: pccbb_pcmcia_socket_enable 00 cardtype io 70
	pccbb_pcmcia_do_io_map win 0 addr 0x4500 size 0x40 width 0
	 start 00 45, stop 3f 45, ioctl 02 enable 40
	  :
	wi0: using RF:PRISM2.5 MAC:ISL3873, Firmware: 1.3 variant 4
	  :

	and wi device attached.

>How-To-Repeat:
	attach wi device to CardBus slot.
>Fix:
	This is VERY ADHOC patch...

	I think pcic on isa machine has NO problem. (not tested)
	See sys/dev/isa/i82365_isasubr.c, line 367-373.
	(and kernel options PCIC_ISA_ALLOC_IOBASE)

	Should fix sys/dev/pci/pccbb.c::pccbb_pcmcia_io_alloc ?

Index: if_wi_pcmcia.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pcmcia/if_wi_pcmcia.c,v
retrieving revision 1.13
diff -u -r1.13 if_wi_pcmcia.c
--- if_wi_pcmcia.c	2001/11/18 04:27:49	1.13
+++ if_wi_pcmcia.c	2001/11/26 17:15:05
@@ -303,7 +308,7 @@
 	struct wi_softc *sc = &psc->sc_wi;

 	/* Allocate/map I/O space. */
-	if (pcmcia_io_alloc(psc->sc_pf, cfe->iospace[0].start,
+	if (pcmcia_io_alloc(psc->sc_pf, cfe->iospace[0].start + 0x500,
 	    cfe->iospace[0].length, WI_IOSIZE,
 	    &psc->sc_pcioh) != 0) {
 		printf("%s: can't allocate i/o space\n",
>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.