Lines Matching +full:close +full:- +full:range
93 "usage: pciconf -l [-BbcevV] [device]\n" in usage()
94 " pciconf -a device\n" in usage()
95 " pciconf -r [-b | -h] device addr[:addr2]\n" in usage()
96 " pciconf -w [-b | -h] device addr value\n" in usage()
97 " pciconf -D [-b | -h | -x] device bar [start [count]]" in usage()
113 while ((c = getopt(argc, argv, "aBbcDehlrwVv")) != -1) { in main()
236 if (ioctl(fd, PCIOCGETCONF, &pc) == -1) in list_devs()
250 close(fd); in list_devs()
255 close(fd); in list_devs()
266 *p->pd_name ? p->pd_name : "none", in list_devs()
267 *p->pd_name ? (int)p->pd_unit : in list_devs()
268 none_count++, p->pc_sel.pc_domain, in list_devs()
269 p->pc_sel.pc_bus, p->pc_sel.pc_dev, in list_devs()
270 p->pc_sel.pc_func, (p->pc_class << 16) | in list_devs()
271 (p->pc_subclass << 8) | p->pc_progif, in list_devs()
272 p->pc_revid, p->pc_hdr, in list_devs()
273 p->pc_vendor, p->pc_device, in list_devs()
274 p->pc_subvendor, p->pc_subdevice); in list_devs()
280 *p->pd_name ? p->pd_name : "none", in list_devs()
281 *p->pd_name ? (int)p->pd_unit : in list_devs()
282 none_count++, p->pc_sel.pc_domain, in list_devs()
283 p->pc_sel.pc_bus, p->pc_sel.pc_dev, in list_devs()
284 p->pc_sel.pc_func, (p->pc_class << 16) | in list_devs()
285 (p->pc_subclass << 8) | p->pc_progif, in list_devs()
286 p->pc_revid, p->pc_hdr, in list_devs()
287 p->pc_vendor, p->pc_device, in list_devs()
288 p->pc_subvendor, p->pc_subdevice); in list_devs()
304 close(fd); in list_devs()
312 secbus = read_config(fd, &p->pc_sel, secreg, 1); in print_bus_range()
313 subbus = read_config(fd, &p->pc_sel, subreg, 1); in print_bus_range()
314 printf(" bus range = %u-%u\n", secbus, subbus); in print_bus_range()
318 print_window(int reg, const char *type, int range, uint64_t base, in print_window() argument
322 printf(" window[%02x] = type %s, range %2d, addr %#jx-%#jx, %s\n", in print_window()
323 reg, type, range, (uintmax_t)base, (uintmax_t)limit, in print_window()
356 int range; in print_bridge_windows() local
364 val = read_config(fd, &p->pc_sel, PCIR_IOBASEL_1, 1); in print_bridge_windows()
365 if (val != 0 || read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1) != 0) { in print_bridge_windows()
368 read_config(fd, &p->pc_sel, PCIR_IOBASEH_1, 2), in print_bridge_windows()
371 read_config(fd, &p->pc_sel, PCIR_IOLIMITH_1, 2), in print_bridge_windows()
372 read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1)); in print_bridge_windows()
373 range = 32; in print_bridge_windows()
377 read_config(fd, &p->pc_sel, PCIR_IOLIMITL_1, 1)); in print_bridge_windows()
378 range = 16; in print_bridge_windows()
380 print_window(PCIR_IOBASEL_1, "I/O Port", range, base, limit); in print_bridge_windows()
384 read_config(fd, &p->pc_sel, PCIR_MEMBASE_1, 2)); in print_bridge_windows()
386 read_config(fd, &p->pc_sel, PCIR_MEMLIMIT_1, 2)); in print_bridge_windows()
389 val = read_config(fd, &p->pc_sel, PCIR_PMBASEL_1, 2); in print_bridge_windows()
390 if (val != 0 || read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2) != 0) { in print_bridge_windows()
393 read_config(fd, &p->pc_sel, PCIR_PMBASEH_1, 4), in print_bridge_windows()
396 read_config(fd, &p->pc_sel, PCIR_PMLIMITH_1, 4), in print_bridge_windows()
397 read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2)); in print_bridge_windows()
398 range = 64; in print_bridge_windows()
402 read_config(fd, &p->pc_sel, PCIR_PMLIMITL_1, 2)); in print_bridge_windows()
403 range = 32; in print_bridge_windows()
405 print_window(PCIR_PMBASEL_1, "Prefetchable Memory", range, base, in print_bridge_windows()
413 subtractive = p->pc_progif == PCIP_BRIDGE_PCI_SUBTRACTIVE; in print_bridge_windows()
414 switch (p->pc_device << 16 | p->pc_vendor) { in print_bridge_windows()
420 if (p->pc_vendor == 0x8086 && (p->pc_device & 0xff00) == 0x2400) in print_bridge_windows()
423 bctl = read_config(fd, &p->pc_sel, PCIR_BRIDGECTL_1, 2); in print_bridge_windows()
434 PCI_CBBMEMBASE(read_config(fd, &p->pc_sel, basereg, 4)), in print_cardbus_mem_window()
435 PCI_CBBMEMLIMIT(read_config(fd, &p->pc_sel, limitreg, 4))); in print_cardbus_mem_window()
443 int range; in print_cardbus_io_window() local
445 val = read_config(fd, &p->pc_sel, basereg, 2); in print_cardbus_io_window()
447 base = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, basereg, 4)); in print_cardbus_io_window()
448 limit = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, limitreg, 4)); in print_cardbus_io_window()
449 range = 32; in print_cardbus_io_window()
452 limit = PCI_CBBIOBASE(read_config(fd, &p->pc_sel, limitreg, 2)); in print_cardbus_io_window()
453 range = 16; in print_cardbus_io_window()
455 print_window(basereg, "I/O Port", range, base, limit); in print_cardbus_io_window()
463 bctl = read_config(fd, &p->pc_sel, PCIR_BRIDGECTL_2, 2); in print_cardbus_windows()
478 switch (p->pc_hdr & PCIM_HDRTYPE) { in list_bridge()
495 switch (p->pc_hdr & PCIM_HDRTYPE) { in list_bars()
519 int range; in print_bar() local
521 bar.pbi_sel = p->pc_sel; in print_bar()
527 range = 32; in print_bar()
536 range = 32; in print_bar()
539 range = 20; in print_bar()
542 range = 64; in print_bar()
545 range = -1; in print_bar()
549 printf(" %s[%02x] = type %s, range %2d, base %#jx, ", in print_bar()
550 label, bar_offset, type, range, (uintmax_t)base); in print_bar()
563 if (vi->id == p->pc_vendor) { in list_verbose()
564 printf(" vendor = '%s'\n", vi->desc); in list_verbose()
571 TAILQ_FOREACH(di, &vi->devs, link) { in list_verbose()
572 if (di->id == p->pc_device) { in list_verbose()
573 printf(" device = '%s'\n", di->desc); in list_verbose()
590 list.plvi_sel = p->pc_sel; in list_vpd()
605 if (vpd->pve_flags == PVE_FLAG_IDENT) { in list_vpd()
607 (int)vpd->pve_datalen, vpd->pve_data); in list_vpd()
612 if (!(vpd->pve_flags & PVE_FLAG_RW) && in list_vpd()
613 memcmp(vpd->pve_keyword, "RV", 2) == 0) in list_vpd()
616 /* Ignore remaining read-write space. */ in list_vpd()
617 if (vpd->pve_flags & PVE_FLAG_RW && in list_vpd()
618 memcmp(vpd->pve_keyword, "RW", 2) == 0) in list_vpd()
622 if (!(vpd->pve_flags & PVE_FLAG_RW) && in list_vpd()
623 memcmp(vpd->pve_keyword, "CP", 2) == 0) { in list_vpd()
625 (unsigned int)vpd->pve_data[0], in list_vpd()
626 PCIR_BAR((unsigned int)vpd->pve_data[1]), in list_vpd()
627 (unsigned int)vpd->pve_data[3] << 8 | in list_vpd()
628 (unsigned int)vpd->pve_data[2]); in list_vpd()
634 vpd->pve_flags & PVE_FLAG_RW ? "rw" : "ro", in list_vpd()
635 vpd->pve_keyword[0], vpd->pve_keyword[1], in list_vpd()
636 (int)vpd->pve_datalen, vpd->pve_data); in list_vpd()
642 * This is a direct cut-and-paste from the table in sys/dev/pci/pci.c.
650 {PCIC_OLD, -1, "old"},
651 {PCIC_OLD, PCIS_OLD_NONVGA, "non-VGA display device"},
652 {PCIC_OLD, PCIS_OLD_VGA, "VGA-compatible display device"},
653 {PCIC_STORAGE, -1, "mass storage"},
664 {PCIC_NETWORK, -1, "network"},
674 {PCIC_DISPLAY, -1, "display"},
678 {PCIC_MULTIMEDIA, -1, "multimedia"},
683 {PCIC_MEMORY, -1, "memory"},
686 {PCIC_BRIDGE, -1, "bridge"},
687 {PCIC_BRIDGE, PCIS_BRIDGE_HOST, "HOST-PCI"},
688 {PCIC_BRIDGE, PCIS_BRIDGE_ISA, "PCI-ISA"},
689 {PCIC_BRIDGE, PCIS_BRIDGE_EISA, "PCI-EISA"},
690 {PCIC_BRIDGE, PCIS_BRIDGE_MCA, "PCI-MCA"},
691 {PCIC_BRIDGE, PCIS_BRIDGE_PCI, "PCI-PCI"},
692 {PCIC_BRIDGE, PCIS_BRIDGE_PCMCIA, "PCI-PCMCIA"},
693 {PCIC_BRIDGE, PCIS_BRIDGE_NUBUS, "PCI-NuBus"},
694 {PCIC_BRIDGE, PCIS_BRIDGE_CARDBUS, "PCI-CardBus"},
695 {PCIC_BRIDGE, PCIS_BRIDGE_RACEWAY, "PCI-RACEway"},
697 "Semi-transparent PCI-to-PCI"},
698 {PCIC_BRIDGE, PCIS_BRIDGE_INFINIBAND, "InfiniBand-PCI"},
700 "AdvancedSwitching-PCI"},
701 {PCIC_SIMPLECOMM, -1, "simple comms"},
706 {PCIC_BASEPERIPH, -1, "base peripheral"},
711 {PCIC_BASEPERIPH, PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug controller"},
716 {PCIC_INPUTDEV, -1, "input device"},
722 {PCIC_DOCKING, -1, "docking station"},
723 {PCIC_PROCESSOR, -1, "processor"},
724 {PCIC_SERIALBUS, -1, "serial bus"},
736 {PCIC_WIRELESS, -1, "wireless controller"},
748 {PCIC_INTELLIIO, -1, "intelligent I/O controller"},
750 {PCIC_SATCOM, -1, "satellite communication"},
755 {PCIC_CRYPTO, -1, "encrypt/decrypt"},
758 {PCIC_DASP, -1, "dasp"},
763 {PCIC_ACCEL, -1, "processing accelerators"},
765 {PCIC_INSTRUMENT, -1, "non-essential instrumentation"},
775 if (pci_nomatch_tab[i].class == p->pc_class) in guess_class()
787 if ((pci_nomatch_tab[i].class == p->pc_class) && in guess_subclass()
788 (pci_nomatch_tab[i].subclass == p->pc_subclass)) in guess_subclass()
829 ch = strchr(buf, '\0') - 1; in load_vendors()
831 *ch-- = '\0'; in load_vendors()
848 if ((cv->desc = strdup(str)) == NULL) { in load_vendors()
854 cv->id = id; in load_vendors()
855 TAILQ_INIT(&cv->devs); in load_vendors()
873 if ((cd->desc = strdup(str)) == NULL) { in load_vendors()
879 cd->id = id; in load_vendors()
880 TAILQ_INSERT_TAIL(&cv->devs, cd, link); in load_vendors()
936 cp--; in getdevice()
937 while (cp != name && isdigit(cp[-1])) in getdevice()
938 cp--; in getdevice()
941 if ((size_t)(cp - name) + 1 > sizeof(patterns[0].pd_name)) in getdevice()
943 memcpy(patterns[0].pd_name, name, cp - name); in getdevice()
952 if (ioctl(fd, PCIOCGETCONF, &pc) == -1) in getdevice()
957 close(fd); in getdevice()
988 sel.pc_func = (i > 2) ? selarr[--i] : 0; in parsesel()
989 sel.pc_dev = (i > 0) ? selarr[--i] : 0; in parsesel()
990 sel.pc_bus = (i > 0) ? selarr[--i] : 0; in parsesel()
991 sel.pc_domain = (i > 0) ? selarr[--i] : 0; in parsesel()
1048 close(fd); in readit()
1068 close(fd); in writeit()
1088 close(fd); in chkattached()
1141 count = (pbm.pbm_bar_length - start * width) / width; in dump_bar()
1146 "off %#x length %#jx from %#jx count %#jx in %d-bytes\n", in dump_bar()
1202 close(fd); in dump_bar()