Lines Matching refs:nexus

61 typedef struct nexus {  struct
68 struct nexus *next; argument
144 static int probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, probe_info_t *pinfo);
146 static int do_probe(nexus_t *nexus, probe_info_t *pinfo);
175 nexus_t *nexus; in find_nexus_for_dev() local
178 for (nexus = nexus_list ; nexus != NULL ; nexus = nexus->next) { in find_nexus_for_dev()
179 for (i = 0; i < nexus->num_devices; i++) { in find_nexus_for_dev()
180 if (nexus->devlist[i] == dev) in find_nexus_for_dev()
181 return nexus; in find_nexus_for_dev()
190 nexus_t *nexus; in find_nexus_for_bus() local
192 for (nexus = nexus_list ; nexus != NULL ; nexus = nexus->next) { in find_nexus_for_bus()
193 if ((domain == nexus->domain) && in find_nexus_for_bus()
194 (bus >= nexus->first_bus) && (bus <= nexus->last_bus)) { in find_nexus_for_bus()
195 return nexus; in find_nexus_for_bus()
223 nexus_t *nexus, *next; in pci_system_solx_devfs_destroy() local
225 for (nexus = nexus_list ; nexus != NULL ; nexus = next) { in pci_system_solx_devfs_destroy()
226 next = nexus->next; in pci_system_solx_devfs_destroy()
227 close(nexus->fd); in pci_system_solx_devfs_destroy()
228 free(nexus->path); in pci_system_solx_devfs_destroy()
229 free(nexus->dev_path); in pci_system_solx_devfs_destroy()
235 for (i = 0; i < nexus->num_devices; i++) { in pci_system_solx_devfs_destroy()
236 dev = nexus->devlist[i]; in pci_system_solx_devfs_destroy()
241 free(nexus->devlist); in pci_system_solx_devfs_destroy()
243 free(nexus); in pci_system_solx_devfs_destroy()
351 probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, probe_info_t *pinfo) in probe_dev() argument
398 if (((rval = ioctl(nexus->fd, PCITOOL_DEVICE_GET_REG, prg_p)) != 0) || in probe_dev()
457 if ((rval = get_config_header(nexus->fd, prg_p->bus_no, in probe_dev()
480 pci_base->domain = nexus->domain; in probe_dev()
507 nexus->path, prg_p->bus_no, prg_p->dev_no, func); in probe_dev()
532 nexus->devlist[nexus->num_devices++] = pci_base; in probe_dev()
534 if (nexus->num_devices == nexus->num_allocated_elems) { in probe_dev()
536 size_t new_num_elems = nexus->num_allocated_elems * 2; in probe_dev()
538 new_devs = realloc(nexus->devlist, in probe_dev()
542 (void) memset(&new_devs[nexus->num_devices], 0, in probe_dev()
543 nexus->num_allocated_elems * in probe_dev()
545 nexus->num_allocated_elems = new_num_elems; in probe_dev()
546 nexus->devlist = new_devs; in probe_dev()
573 nexus_t *nexus; in probe_nexus_node() local
667 nexus = calloc(1, sizeof(nexus_t)); in probe_nexus_node()
668 if (nexus == NULL) { in probe_nexus_node()
673 nexus->first_bus = first_bus; in probe_nexus_node()
674 nexus->last_bus = last_bus; in probe_nexus_node()
675 nexus->domain = domain; in probe_nexus_node()
678 if ((nexus->devlist = calloc(INITIAL_NUM_DEVICES, in probe_nexus_node()
682 free (nexus); in probe_nexus_node()
685 nexus->num_allocated_elems = INITIAL_NUM_DEVICES; in probe_nexus_node()
686 nexus->num_devices = 0; in probe_nexus_node()
693 free(nexus); in probe_nexus_node()
706 nexus->fd = fd; in probe_nexus_node()
707 nexus->path = strdup(nexus_path); in probe_nexus_node()
709 nexus->dev_path = strdup(nexus_dev_path); in probe_nexus_node()
711 if ((do_probe(nexus, pinfo) != 0) && (errno != ENXIO)) { in probe_nexus_node()
715 free(nexus->path); in probe_nexus_node()
716 free(nexus->dev_path); in probe_nexus_node()
717 free(nexus); in probe_nexus_node()
719 nexus->next = nexus_list; in probe_nexus_node()
720 nexus_list = nexus; in probe_nexus_node()
725 free(nexus); in probe_nexus_node()
740 do_probe(nexus_t *nexus, probe_info_t *pinfo) in do_probe() argument
745 uint32_t last_bus = nexus->last_bus; in do_probe()
747 uint8_t first_bus = nexus->first_bus; in do_probe()
774 rval = probe_dev(nexus, &prg, pinfo); in do_probe()
863 nexus_t *nexus; in pci_device_solx_devfs_probe() local
866 if ( (nexus = find_nexus_for_dev(dev)) == NULL ) in pci_device_solx_devfs_probe()
868 if ( (nexus = find_nexus_for_bus(dev->domain, dev->bus)) == NULL ) in pci_device_solx_devfs_probe()
876 if ((rnode = di_init(nexus->dev_path, DINFOCPYALL)) == DI_NODE_NIL) { in pci_device_solx_devfs_probe()
1040 nexus_t *nexus; in pci_device_solx_devfs_read() local
1043 nexus = find_nexus_for_dev(dev); in pci_device_solx_devfs_read()
1045 nexus = find_nexus_for_bus(dev->domain, dev->bus); in pci_device_solx_devfs_read()
1050 if ( nexus == NULL ) { in pci_device_solx_devfs_read()
1066 if ((err = ioctl(nexus->fd, PCITOOL_DEVICE_GET_REG, &cfg_prg)) != 0) { in pci_device_solx_devfs_read()
1068 nexus->path, in pci_device_solx_devfs_read()
1098 nexus_t *nexus; in pci_device_solx_devfs_write() local
1101 nexus = find_nexus_for_dev(dev); in pci_device_solx_devfs_write()
1103 nexus = find_nexus_for_bus(dev->domain, dev->bus); in pci_device_solx_devfs_write()
1110 if ( nexus == NULL ) { in pci_device_solx_devfs_write()
1150 if ((err = ioctl(nexus->fd, cmd, &cfg_prg)) != 0) { in pci_device_solx_devfs_write()