/* * Call some function with each vertex that * might be one of this driver's attach points. */ void pciio_iterate(char *driver_prefix, pciio_iter_f * func) { /* a driver's init routine might call * pciio_iterate before the * system calls pciio_init; so we * make the init call ourselves here. */ if (pciio_registry == NULL) pciio_init(); ASSERT(pciio_registry != NULL); cdl_iterate(pciio_registry, driver_prefix, (cdl_iter_f *) func); }
/*ARGSUSED4 */ int pciio_driver_register( pciio_vendor_id_t vendor_id, pciio_device_id_t device_id, char *driver_prefix, unsigned flags) { /* a driver's init routine might call * pciio_driver_register before the * system calls pciio_init; so we * make the init call ourselves here. */ if (pciio_registry == NULL) pciio_init(); return cdl_add_driver(pciio_registry, vendor_id, device_id, driver_prefix, flags, NULL); }
void sgi_master_io_infr_init(void) { int cnode; extern int maxnodes; /* * Do any early init stuff .. einit_tbl[] etc. */ DBG("--> sgi_master_io_infr_init: calling init_hcl().\n"); init_hcl(); /* Sets up the hwgraph compatibility layer with devfs */ /* * initialize the Linux PCI to xwidget vertexes .. */ DBG("--> sgi_master_io_infr_init: calling pci_bus_cvlink_init().\n"); pci_bus_cvlink_init(); /* * Hack to provide statically initialzed klgraph entries. */ DBG("--> sgi_master_io_infr_init: calling klgraph_hack_init()\n"); klgraph_hack_init(); /* * This is the Master CPU. Emulate mlsetup and main.c in Irix. */ DBG("--> sgi_master_io_infr_init: calling mlreset(0).\n"); mlreset(0); /* Master .. */ /* * allowboot() is called by kern/os/main.c in main() * Emulate allowboot() ... * per_cpu_init() - only need per_hub_init() * cpu_io_setup() - Nothing to do. * */ DBG("--> sgi_master_io_infr_init: calling sn_mp_setup().\n"); sn_mp_setup(); DBG("--> sgi_master_io_infr_init: calling per_hub_init(0).\n"); for (cnode = 0; cnode < maxnodes; cnode++) { per_hub_init(cnode); } /* We can do headless hub cnodes here .. */ /* * io_init[] stuff. * * Get SGI IO Infrastructure drivers to init and register with * each other etc. */ DBG("--> sgi_master_io_infr_init: calling hubspc_init()\n"); hubspc_init(); DBG("--> sgi_master_io_infr_init: calling pciba_init()\n"); pciba_init(); DBG("--> sgi_master_io_infr_init: calling pciio_init()\n"); pciio_init(); DBG("--> sgi_master_io_infr_init: calling pcibr_init()\n"); pcibr_init(); DBG("--> sgi_master_io_infr_init: calling xtalk_init()\n"); xtalk_init(); DBG("--> sgi_master_io_infr_init: calling xbow_init()\n"); xbow_init(); DBG("--> sgi_master_io_infr_init: calling xbmon_init()\n"); xbmon_init(); DBG("--> sgi_master_io_infr_init: calling pciiox_init()\n"); pciiox_init(); DBG("--> sgi_master_io_infr_init: calling usrpci_init()\n"); usrpci_init(); DBG("--> sgi_master_io_infr_init: calling ioc3_init()\n"); ioc3_init(); /* * * Our IO Infrastructure drivers are in place .. * Initialize the whole IO Infrastructure .. xwidget/device probes. * */ DBG("--> sgi_master_io_infr_init: Start Probe and IO Initialization\n"); initialize_io(); DBG("--> sgi_master_io_infr_init: Setting up SGI IO Links for Linux PCI\n"); pci_bus_to_hcl_cvlink(); DBG("--> Leave sgi_master_io_infr_init: DONE setting up SGI Links for PCI\n"); }