Glauber Costa b2458ad
Index: /trunk/openbios-devel/drivers/pci.c
Glauber Costa b2458ad
===================================================================
Glauber Costa b2458ad
--- /trunk/openbios-devel/drivers/pci.c (revision 449)
Glauber Costa b2458ad
+++ /trunk/openbios-devel/drivers/pci.c (revision 481)
Glauber Costa b2458ad
@@ -37,5 +37,6 @@
Glauber Costa b2458ad
 /* DECLARE data structures for the nodes.  */
Glauber Costa b2458ad
 
Glauber Costa b2458ad
-DECLARE_UNNAMED_NODE( ob_pci_node, INSTALL_OPEN, 2*sizeof(int) );
Glauber Costa b2458ad
+DECLARE_UNNAMED_NODE( ob_pci_bus_node, INSTALL_OPEN, 2*sizeof(int) );
Glauber Costa b2458ad
+DECLARE_UNNAMED_NODE( ob_pci_simple_node, INSTALL_OPEN, 2*sizeof(int) );
Glauber Costa b2458ad
 
Glauber Costa b2458ad
 const pci_arch_t *arch;
Glauber Costa b2458ad
@@ -157,5 +158,5 @@
Glauber Costa b2458ad
 }
Glauber Costa b2458ad
 
Glauber Costa b2458ad
-NODE_METHODS(ob_pci_node) = {
Glauber Costa b2458ad
+NODE_METHODS(ob_pci_bus_node) = {
Glauber Costa b2458ad
 	{ NULL,			ob_pci_initialize	},
Glauber Costa b2458ad
 	{ "open",		ob_pci_open		},
Glauber Costa b2458ad
@@ -163,4 +164,10 @@
Glauber Costa b2458ad
 	{ "decode-unit",	ob_pci_decode_unit	},
Glauber Costa b2458ad
 	{ "encode-unit",	ob_pci_encode_unit	},
Glauber Costa b2458ad
+};
Glauber Costa b2458ad
+
Glauber Costa b2458ad
+NODE_METHODS(ob_pci_simple_node) = {
Glauber Costa b2458ad
+	{ NULL,			ob_pci_initialize	},
Glauber Costa b2458ad
+	{ "open",		ob_pci_open		},
Glauber Costa b2458ad
+	{ "close",		ob_pci_close		},
Glauber Costa b2458ad
 };
Glauber Costa b2458ad
 
Glauber Costa b2458ad
@@ -738,5 +745,10 @@
Glauber Costa b2458ad
 			config.dev = addr & 0x00FFFFFF;
Glauber Costa b2458ad
 
Glauber Costa b2458ad
-			REGISTER_NAMED_NODE(ob_pci_node, config.path);
Glauber Costa b2458ad
+                        if (class == PCI_BASE_CLASS_BRIDGE &&
Glauber Costa b2458ad
+                            (subclass == PCI_SUBCLASS_BRIDGE_HOST ||
Glauber Costa b2458ad
+                             subclass == PCI_SUBCLASS_BRIDGE_PCI))
Glauber Costa b2458ad
+                            REGISTER_NAMED_NODE(ob_pci_bus_node, config.path);
Glauber Costa b2458ad
+                        else
Glauber Costa b2458ad
+                            REGISTER_NAMED_NODE(ob_pci_simple_node, config.path);
Glauber Costa b2458ad
 
Glauber Costa b2458ad
 			activate_device(config.path);