Subject: Re: pciide/atabus changes
To: None <port-sparc64@NetBSD.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-sparc64
Date: 10/12/2003 17:09:48
--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Oct 09, 2003 at 08:29:09PM +0200, Manuel Bouyer wrote:
> In fast this does work. The problem is that device_register() calls
> dev_compatible() (which is OK) and then calls bus_class().
> If the device name isn't in bus_class_tab[], we loose.
> I'm not sure what is best here: change bus_class() to match on pa->pa_class
> too for PCI devices, or just add the names to bus_class_tab[].

OK, following Christos's suggestion, I changed bus_class() to use pmatch(),
so that we can use *ide in bus_class_tab[]. This seems to work nicely here.

Should I commit this ?

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 24 ans d'experience feront toujours la difference
--

--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/sparc64/autoconf.c,v
retrieving revision 1.83
diff -u -r1.83 autoconf.c
--- autoconf.c	2003/10/09 17:55:44	1.83
+++ autoconf.c	2003/10/12 15:06:39
@@ -972,9 +972,7 @@
 	{ "ledma",	BUSCLASS_SBUS },
 	{ "simba",	BUSCLASS_PCI },
 	{ "ppb",	BUSCLASS_PCI },
-	{ "pciide",	BUSCLASS_PCI },
-	{ "cmdide",	BUSCLASS_PCI },
-	{ "aceride",	BUSCLASS_PCI },
+	{ "*ide",	BUSCLASS_PCI },
 	{ "siop",	BUSCLASS_PCI },
 	{ "esiop",	BUSCLASS_PCI },
 	{ "pci",	BUSCLASS_PCI },
@@ -1110,7 +1108,7 @@
 
 	name = dev->dv_cfdata->cf_name;
 	for (i = sizeof(bus_class_tab)/sizeof(bus_class_tab[0]); i-- > 0;) {
-		if (strcmp(name, bus_class_tab[i].name) == 0) {
+		if (pmatch(name, bus_class_tab[i].name, NULL) == 2) {
 			class = bus_class_tab[i].class;
 			break;
 		}

--5mCyUwZo2JvN/JJP--