From nobody@FreeBSD.org  Tue Aug 30 18:11:01 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AA83116A425
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Aug 2005 18:11:01 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AA88F43ED3
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Aug 2005 18:07:06 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j7UI70fn021120
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Aug 2005 18:07:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j7UI70gH021119;
	Tue, 30 Aug 2005 18:07:00 GMT
	(envelope-from nobody)
Message-Id: <200508301807.j7UI70gH021119@www.freebsd.org>
Date: Tue, 30 Aug 2005 18:07:00 GMT
From: Keiji Wada <keiji@hiemalis.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: OLDCARD can't probe ed driver
X-Send-Pr-Version: www-2.3

>Number:         85493
>Category:       kern
>Synopsis:       [ed] [patch] OLDCARD can't probe ed driver
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    imp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 30 18:20:00 GMT 2005
>Closed-Date:    Fri May 13 14:00:04 MDT 2011
>Last-Modified:  Fri May 13 14:00:04 MDT 2011
>Originator:     Keiji Wada
>Release:        RELENG_5
>Organization:
wada
>Environment:
FreeBSD spinach.net2.jp 5.4-STABLE FreeBSD 5.4-STABLE #0: Mon Jul 18 17:53:57 JST 2005     keiji@spinach.net2.jp:/home/spinach/keiji/ftp/HARD/yacxm/sys/i386/compile/SPINACH  i386

>Description:
OLDCARD can't probe ed driver. pccardd recognize PCMCIA card with OLDCARD. But ed_pccard_probe use NEWCARD.
>How-To-Repeat:
The old machine with OLDCARD can't probe ed.
>Fix:
--- if_ed_pccard.c.1.59.2.3	Tue Aug 30 22:58:42 2005
+++ if_ed_pccard.c	Wed Aug 31 02:48:09 2005
@@ -216,27 +216,28 @@
 static int
 ed_pccard_probe(device_t dev)
 {
-	const struct ed_product *pp;
 	int	error;
+	int	flags = device_get_flags(dev);
 
-	if ((pp = (const struct ed_product *) pccard_product_lookup(dev, 
-	    (const struct pccard_product *) ed_pccard_products,
-	    sizeof(ed_pccard_products[0]), NULL)) == NULL)
-		return (ENXIO);
-	if (pp->flags & NE2000DVF_DL10019) {
-		error = ed_probe_Novell(dev, 0, 0);
-		if (error == 0)
-			error = ed_pccard_Linksys(dev);
-		ed_release_resources(dev);
-		if (error == 0)
-			goto end2;
-	}
-	if (pp->flags & NE2000DVF_AX88190) {
+	if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_AX88190) {
 		error = ed_pccard_ax88190(dev);
-		if (error == 0)
-			goto end2;
+		goto end2;
 	}
-	error = ed_probe_Novell(dev, 0, 0);
+
+	error = ed_probe_Novell(dev, 0, flags);
+	if (error == 0)
+		goto end;
+	ed_release_resources(dev);
+
+	error = ed_probe_WD80x3(dev, 0, flags);
+	if (error == 0)
+		goto end;
+	ed_release_resources(dev);
+	goto end2;
+
+end:
+	if (ED_FLAGS_GETTYPE(flags) & ED_FLAGS_LINKSYS)
+		ed_pccard_Linksys(dev);
 end2:
 	if (error == 0)
 		error = ed_alloc_irq(dev, 0, 0);

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->imp 
Responsible-Changed-By: kris 
Responsible-Changed-When: Wed Sep 21 07:01:49 GMT 2005 
Responsible-Changed-Why:  
Assign to pccard maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=85493 

From: Wada Keiji <keiji@hiemalis.org>
To: imp@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org,
 freebsd-bugs@FreeBSD.org
Cc: keiji@hiemalis.org
Subject: Re: kern/85493: OLDCARD can't probe ed driver
Date: Thu, 21 Sep 2006 01:03:58 +0900 (JST)

 Hello imp!
 
 Why don't you accept my change request?
 
 Did you read sys/dev/pccard/card_if.m
 # Compatibility methods for OLDCARD drivers.  We use these routines to make
 # it possible to call the OLDCARD driver's probe routine in the context that
 # it expects.  For OLDCARD these are implemented as pass throughs to the
 # device_{probe,attach} routines.  For NEWCARD they are implemented such
 # such that probe becomes strictly a matching routine and attach does both
 # the old probe and old attach.
 #
 # compat devices should use the following:
 #
 #       /* Device interface */
 #       DEVMETHOD(device_probe),        pccard_compat_probe),
 #       DEVMETHOD(device_attach),       pccard_compat_attach),
 #       /* Card interface */
 #       DEVMETHOD(card_compat_match,    foo_match),     /* newly written */
 #       DEVMETHOD(card_compat_probe,    foo_probe),     /* old probe */
 #       DEVMETHOD(card_compat_attach,   foo_attach),    /* old attach */
 
 I think that card_compat_probe is used on OLDCARD. And on ed
 ed_pccard_probe is used too. So ed_pccard_probe can't use
 pccard_product_lookup function.
 
 What do you think?
 
 Thanks.
 
 >>>>> On Tue, 30 Aug 2005 18:20:00 GMT
 >>>>> FreeBSD-gnats-submit@FreeBSD.org said:
 > 
 > Thank you very much for your problem report.
 > It has the internal identification `kern/85493'.
 > The individual assigned to look at your
 > report is: freebsd-bugs. 
 > 
 > You can access the state of your problem report at any time
 > via this link:
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=85493
 > 
 > >Category:       kern
 > >Responsible:    freebsd-bugs
 > >Synopsis:       OLDCARD can't probe ed driver
 > >Arrival-Date:   Tue Aug 30 18:20:00 GMT 2005

From: "M. Warner Losh" <imp@bsdimp.com>
To: keiji@hiemalis.org
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Subject: Re: kern/85493: OLDCARD can't probe ed driver
Date: Wed, 20 Sep 2006 10:49:04 -0600 (MDT)

 In message: <20060921.010358.39312857.keiji@hiemalis.org>
             Wada Keiji <keiji@hiemalis.org> writes:
 : Hello imp!
 : 
 : Why don't you accept my change request?
 : 
 : Did you read sys/dev/pccard/card_if.m
 : # Compatibility methods for OLDCARD drivers.  We use these routines to make
 : # it possible to call the OLDCARD driver's probe routine in the context that
 : # it expects.  For OLDCARD these are implemented as pass throughs to the
 : # device_{probe,attach} routines.  For NEWCARD they are implemented such
 : # such that probe becomes strictly a matching routine and attach does both
 : # the old probe and old attach.
 : #
 : # compat devices should use the following:
 : #
 : #       /* Device interface */
 : #       DEVMETHOD(device_probe),        pccard_compat_probe),
 : #       DEVMETHOD(device_attach),       pccard_compat_attach),
 : #       /* Card interface */
 : #       DEVMETHOD(card_compat_match,    foo_match),     /* newly written */
 : #       DEVMETHOD(card_compat_probe,    foo_probe),     /* old probe */
 : #       DEVMETHOD(card_compat_attach,   foo_attach),    /* old attach */
 : 
 : I think that card_compat_probe is used on OLDCARD. And on ed
 : ed_pccard_probe is used too. So ed_pccard_probe can't use
 : pccard_product_lookup function.
 : 
 : What do you think?
 
 OLDCARD has been retro-fitted to allow the use of
 pccard_product_lookup.  If that isn't working, the bug should be fixed
 there.  It has been a long time since I have built and run an oldcard
 kernel.  I kept meaning to get back to this bug, and appologize for my
 lack of action on it.
 
 The patch in this report might fix OLDCARD, but seem to break it for
 NEWCARD, which is why I never applied them.
 
 What is failing in the pccard_product_lookup function?
 
 Warner
 
 : Thanks.
 : 
 : >>>>> On Tue, 30 Aug 2005 18:20:00 GMT
 : >>>>> FreeBSD-gnats-submit@FreeBSD.org said:
 : > 
 : > Thank you very much for your problem report.
 : > It has the internal identification `kern/85493'.
 : > The individual assigned to look at your
 : > report is: freebsd-bugs. 
 : > 
 : > You can access the state of your problem report at any time
 : > via this link:
 : > 
 : > http://www.freebsd.org/cgi/query-pr.cgi?pr=85493
 : > 
 : > >Category:       kern
 : > >Responsible:    freebsd-bugs
 : > >Synopsis:       OLDCARD can't probe ed driver
 : > >Arrival-Date:   Tue Aug 30 18:20:00 GMT 2005
 : 
 : 

From: Wada Keiji <keiji@hiemalis.org>
To: imp@bsdimp.com
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org,
 keiji@hiemalis.org
Subject: Re: kern/85493: OLDCARD can't probe ed driver
Date: Mon, 25 Sep 2006 22:20:05 +0900 (JST)

 Hello
 
 >>>>> On Wed, 20 Sep 2006 10:49:04 -0600 (MDT)
 >>>>> imp@bsdimp.com("M. Warner Losh")  said:
 
 
 imp> OLDCARD has been retro-fitted to allow the use of
 imp> pccard_product_lookup.  If that isn't working, the bug should be fixed
 imp> there.  It has been a long time since I have built and run an oldcard
 imp> kernel.  I kept meaning to get back to this bug, and appologize for my
 imp> lack of action on it.
 
 imp> The patch in this report might fix OLDCARD, but seem to break it for
 imp> NEWCARD, which is why I never applied them.
 
 imp> What is failing in the pccard_product_lookup function?
 
 imp> Warner
 
 Thanks for your reply.
 I've understood FreeBSD 6 and CURRENT do not support pcic.
 I found the your message in freebsd-mobile.
   http://docs.freebsd.org/cgi/getmsg.cgi?fetch=54846+0+archive/2006/freebsd-mobile/20060604.freebsd-mobile
 
 I have two ThinkPad 535E and it now work with router on FreeBSD 5.3.
 I installed RELENG_6 to 535E. But PCI-PCMCIA doesn't work.
 
 535E on FreeBSD 5.3 dmesg:
 pci0: <PCI bus> on pcib0
 isab0: <PCI-ISA bridge> at device 1.0 on pci0
 isa0: <ISA bus> on isab0
 pci0: <display, VGA> at device 3.0 (no driver attached)
 pcic0: <Cirrus Logic PD6729/6730 PCI-PCMCIA Bridge> port 0x3e0-0x3e3 at device 1
 9.0 on pci0
 pcic0: Polling mode
 pccard0: <PC Card 16-bit bus (classic)> on pcic0
 pccard1: <PC Card 16-bit bus (classic)> on pcic0
 
 Keiji
State-Changed-From-To: open->closed 
State-Changed-By: imp 
State-Changed-When: Fri May 13 13:59:43 MDT 2011 
State-Changed-Why:  
OLDCARD is no longer relevant.  Sorry this was never resolved. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=85493 
>Unformatted:
