Subject: kern/11973: wi(4) device needs more extra timeout.
To: None <gnats-bugs@gnats.netbsd.org>
From: Takahiro Kambe <taca@sky.yamashina.kyoto.jp>
List: netbsd-bugs
Date: 01/16/2001 08:52:16
>Number:         11973
>Category:       kern
>Synopsis:       wi(4) device needs more extra timeout.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 16 08:52:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Takahiro Kambe
>Release:        NetBSD-current 2001/1/15
>Organization:
	
>Environment:
	
System: NetBSD edge.sky.yamashina.kyoto.jp 1.5Q NetBSD 1.5Q (CF-M33-PCMCIA) #4: Wed Jan 17 01:32:22 JST 2001 taca@edge.sky.yamashina.kyoto.jp:/usr/src/sys/arch/i386/compile/CF-M33-PCMCIA i386
Architecture: i386
Machine: i386
>Description:
	Wireless LAN card, ADLINK 330C and GW-NS110 are recently thought
	to supported by wi(4).  But those cards are failed to attach.

ADLINK 330C:
wi0: init failed
wi0: could not get mac address, attach failed

GW-NS110:
wi0: init failed
wi0: 802.11 address xx:xx:xx:xx:xx:xx

	But those cards are succeded to attach on 1.5.1-ALPHA machine.

>How-To-Repeat:
	Insert those cards on current machine.
>Fix:
	Adding some delay to wi_cmd() seems to solve the problem.
	The delay()'s value bellow might be more smaller.

Index: if_wi.c
===================================================================
RCS file: /usr/pkg/libdata/cvs/src/sys/dev/pcmcia/if_wi.c,v
retrieving revision 1.1.1.8.2.8
diff -u -r1.1.1.8.2.8 if_wi.c
--- if_wi.c	2001/01/14 14:07:29	1.1.1.8.2.8
+++ if_wi.c	2001/01/16 16:36:41
@@ -773,6 +773,7 @@
 	CSR_WRITE_2(sc, WI_COMMAND, cmd);
 
 	for (i = 0; i < WI_TIMEOUT; i++) {
+	delay(60);
 		/*
 		 * Wait for 'command complete' bit to be
 		 * set in the event status register.

>Release-Note:
>Audit-Trail:
>Unformatted: