2 * $Id: lspci.c,v 1.9 1998/03/19 15:56:43 mj Exp $
4 * Linux PCI Utilities -- List All PCI Devices
6 * Copyright (c) 1997, 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
8 * Can be freely distributed and used under the terms of the GNU GPL.
21 static int verbose; /* Show detailed information */
22 static int buscentric_view; /* Show bus addresses/IRQ's instead of CPU-visible ones */
23 static int show_hex; /* Show contents of config space as hexadecimal numbers */
24 static int bus_filter = -1; /* Bus, slot, function, vendor and device ID filtering */
25 static int slot_filter = -1;
26 static int func_filter = -1;
27 static int vend_filter = -1;
28 static int dev_filter = -1;
29 static int show_tree; /* Show bus tree */
30 static int machine_readable; /* Generate machine-readable output */
31 static char *pci_dir = PROC_BUS_PCI;
33 static char options[] = "nvbxB:S:F:V:D:ti:p:m";
35 static char help_msg[] = "\
36 Usage: lspci [<switches>]\n\
39 -n\tShow numeric ID's\n\
40 -b\tBus-centric view (PCI addresses and IRQ's instead of those seen by the CPU)\n\
41 -x\tShow hex-dump of config space (-xx shows full 256 bytes)\n\
42 -B <bus>, -S <slot>, -F <func>, -V <vendor>, -D <device> Show only selected devices\n\
44 -m\tProduce machine-readable output\n\
45 -i <file>\tUse specified ID database instead of " ETC_PCI_IDS "\n\
46 -p <dir>\tUse specified bus directory instead of " PROC_BUS_PCI "\n\
49 /* Format strings used for IRQ numbers */
52 #define IRQ_FORMAT "%08x"
54 #define IRQ_FORMAT "%d"
57 /* Our view of the PCI bus */
63 unsigned int kernel_irq;
64 unsigned long kernel_base_addr[6];
68 static struct device *first_dev, **last_dev = &first_dev;
70 /* Miscellaneous routines */
73 xmalloc(unsigned int howmuch)
75 void *p = malloc(howmuch);
78 fprintf(stderr, "lspci: Unable to allocate %d bytes of memory\n", howmuch);
87 filter_out(struct device *d)
89 return (bus_filter >= 0 && d->bus != bus_filter ||
90 slot_filter >= 0 && PCI_SLOT(d->devfn) != slot_filter ||
91 func_filter >= 0 && PCI_FUNC(d->devfn) != func_filter ||
92 vend_filter >= 0 && d->vendid != vend_filter ||
93 dev_filter >= 0 && d->devid != dev_filter);
96 /* Interface for /proc/bus/pci */
105 sprintf(name, "%s/devices", pci_dir);
106 if (! (f = fopen(name, "r")))
111 while (fgets(line, sizeof(line), f))
113 struct device *d = xmalloc(sizeof(struct device));
114 unsigned int dfn, vend;
116 sscanf(line, "%x %x %x %lx %lx %lx %lx %lx %lx",
120 &d->kernel_base_addr[0],
121 &d->kernel_base_addr[1],
122 &d->kernel_base_addr[2],
123 &d->kernel_base_addr[3],
124 &d->kernel_base_addr[4],
125 &d->kernel_base_addr[5]);
127 d->devfn = dfn & 0xff;
128 d->vendid = vend >> 16U;
129 d->devid = vend & 0xffff;
141 make_proc_pci_name(struct device *d, char *p)
143 sprintf(p, "%s/%02x/%02x.%x",
144 pci_dir, d->bus, PCI_SLOT(d->devfn), PCI_FUNC(d->devfn));
153 int how_much = (show_hex > 1) ? 256 : 64;
155 for(d=first_dev; d; d=d->next)
157 make_proc_pci_name(d, name);
158 if ((fd = open(name, O_RDONLY)) < 0)
160 fprintf(stderr, "lspci: Unable to open %s: %m\n", name);
163 res = read(fd, d->config, how_much);
166 fprintf(stderr, "lspci: Error reading %s: %m\n", name);
171 fprintf(stderr, "lspci: Only %d bytes of config space available to you\n", res);
185 /* Config space accesses */
188 get_conf_byte(struct device *d, unsigned int pos)
190 return d->config[pos];
194 get_conf_word(struct device *d, unsigned int pos)
196 return d->config[pos] | (d->config[pos+1] << 8);
200 get_conf_long(struct device *d, unsigned int pos)
202 return d->config[pos] |
203 (d->config[pos+1] << 8) |
204 (d->config[pos+2] << 16) |
205 (d->config[pos+3] << 24);
211 compare_them(const void *A, const void *B)
213 const struct device *a = *(const struct device **)A;
214 const struct device *b = *(const struct device **)B;
220 if (a->devfn < b->devfn)
222 if (a->devfn > b->devfn)
230 struct device **index, **h;
235 for(d=first_dev; d; d=d->next)
237 h = index = alloca(sizeof(struct device *) * cnt);
238 for(d=first_dev; d; d=d->next)
240 qsort(index, cnt, sizeof(struct device *), compare_them);
241 last_dev = &first_dev;
246 last_dev = &(*h)->next;
255 show_terse(struct device *d)
259 printf("%02x:%02x.%x %s: %s",
263 lookup_class(get_conf_word(d, PCI_CLASS_DEVICE)),
264 lookup_device_full(d->vendid, d->devid));
265 if (c = get_conf_byte(d, PCI_REVISION_ID))
266 printf(" (rev %02x)", c);
267 if (verbose && (c = get_conf_byte(d, PCI_CLASS_PROG)))
268 printf(" (prog-if %02x)", c);
273 show_bases(struct device *d, int cnt)
275 word cmd = get_conf_word(d, PCI_COMMAND);
281 unsigned int flg = get_conf_long(d, PCI_BASE_ADDRESS_0 + 4*i);
285 pos = d->kernel_base_addr[i];
286 if (!pos || pos == 0xffffffff)
288 if (flg & PCI_BASE_ADDRESS_SPACE_IO)
290 if (cmd & PCI_COMMAND_IO)
293 printf("\tRegion %d: ", i);
296 printf("I/O ports at %04lx\n", pos & PCI_BASE_ADDRESS_IO_MASK);
299 else if (cmd & PCI_COMMAND_MEMORY)
301 int t = flg & PCI_BASE_ADDRESS_MEM_TYPE_MASK;
303 printf("\tRegion %d: ", i);
306 printf("Memory at ");
307 if (t == PCI_BASE_ADDRESS_MEM_TYPE_64)
312 if (!buscentric_view)
313 printf("%08x", get_conf_long(d, PCI_BASE_ADDRESS_0 + 4*i));
318 printf("%08lx (%s, %sprefetchable)\n",
319 pos & PCI_BASE_ADDRESS_MEM_MASK,
320 (t == PCI_BASE_ADDRESS_MEM_TYPE_32) ? "32-bit" :
321 (t == PCI_BASE_ADDRESS_MEM_TYPE_64) ? "64-bit" :
322 (t == PCI_BASE_ADDRESS_MEM_TYPE_1M) ? "low-1M 32-bit" : "???",
323 (flg & PCI_BASE_ADDRESS_MEM_PREFETCH) ? "" : "non-");
329 show_htype0(struct device *d)
331 u32 rom = get_conf_long(d, PCI_ROM_ADDRESS);
337 word cmd = get_conf_word(d, PCI_COMMAND);
338 printf("\tExpansion ROM at %08x%s\n", rom & ~0xfff,
339 (cmd & PCI_COMMAND_MEMORY) ? "" : " [disabled]");
344 show_htype1(struct device *d)
346 u32 io_base = get_conf_byte(d, PCI_IO_BASE);
347 u32 io_limit = get_conf_byte(d, PCI_IO_LIMIT);
348 u32 io_type = io_base & PCI_IO_RANGE_TYPE_MASK;
349 u32 mem_base = get_conf_word(d, PCI_MEMORY_BASE);
350 u32 mem_limit = get_conf_word(d, PCI_MEMORY_LIMIT);
351 u32 mem_type = mem_base & PCI_MEMORY_RANGE_TYPE_MASK;
352 u32 pref_base = get_conf_word(d, PCI_PREF_MEMORY_BASE);
353 u32 pref_limit = get_conf_word(d, PCI_PREF_MEMORY_LIMIT);
354 u32 pref_type = pref_base & PCI_PREF_RANGE_TYPE_MASK;
355 u32 rom = get_conf_long(d, PCI_ROM_ADDRESS1);
356 word brc = get_conf_word(d, PCI_BRIDGE_CONTROL);
359 printf("\tBus: primary=%02x, secondary=%02x, subordinate=%02x, sec-latency=%d\n",
360 get_conf_byte(d, PCI_PRIMARY_BUS),
361 get_conf_byte(d, PCI_SECONDARY_BUS),
362 get_conf_byte(d, PCI_SUBORDINATE_BUS),
363 get_conf_byte(d, PCI_SEC_LATENCY_TIMER));
365 if (io_type != (io_limit & PCI_IO_RANGE_TYPE_MASK) ||
366 (io_type != PCI_IO_RANGE_TYPE_16 && io_type != PCI_IO_RANGE_TYPE_32))
367 printf("\t!!! Unknown I/O range types %x/%x\n", io_base, io_limit);
370 io_base = (io_base & PCI_IO_RANGE_MASK) << 8;
371 io_limit = (io_limit & PCI_IO_RANGE_MASK) << 8;
372 if (io_type == PCI_IO_RANGE_TYPE_32)
374 io_base |= (get_conf_word(d, PCI_IO_BASE_UPPER16) << 16);
375 io_limit |= (get_conf_word(d, PCI_IO_LIMIT_UPPER16) << 16);
378 printf("\tI/O behind bridge: %08x-%08x\n", io_base, io_limit+0xfff);
381 if (mem_type != (mem_limit & PCI_MEMORY_RANGE_TYPE_MASK) ||
383 printf("\t!!! Unknown memory range types %x/%x\n", mem_base, mem_limit);
386 mem_base = (mem_base & PCI_MEMORY_RANGE_MASK) << 16;
387 mem_limit = (mem_limit & PCI_MEMORY_RANGE_MASK) << 16;
388 printf("\tMemory behind bridge: %08x-%08x\n", mem_base, mem_limit + 0xfffff);
391 if (pref_type != (pref_limit & PCI_PREF_RANGE_TYPE_MASK) ||
392 (pref_type != PCI_PREF_RANGE_TYPE_32 && pref_type != PCI_PREF_RANGE_TYPE_64))
393 printf("\t!!! Unknown prefetchable memory range types %x/%x\n", pref_base, pref_limit);
396 pref_base = (pref_base & PCI_PREF_RANGE_MASK) << 16;
397 pref_limit = (pref_limit & PCI_PREF_RANGE_MASK) << 16;
398 if (pref_type == PCI_PREF_RANGE_TYPE_32)
399 printf("\tPrefetchable memory behind bridge: %08x-%08x\n", pref_base, pref_limit);
401 printf("\tPrefetchable memory behind bridge: %08x%08x-%08x%08x\n",
402 get_conf_long(d, PCI_PREF_BASE_UPPER32),
404 get_conf_long(d, PCI_PREF_LIMIT_UPPER32),
408 if (get_conf_word(d, PCI_SEC_STATUS) & PCI_STATUS_SIG_SYSTEM_ERROR)
409 printf("\tSecondary status: SERR\n");
413 word cmd = get_conf_word(d, PCI_COMMAND);
414 printf("\tExpansion ROM at %08x%s\n", rom & ~0xfff,
415 (cmd & PCI_COMMAND_MEMORY) ? "" : " [disabled]");
419 printf("\tBridgeCtl: Parity%c SERR%c NoISA%c VGA%c MAbort%c >Reset%c FastB2B%c\n",
420 (brc & PCI_BRIDGE_CTL_PARITY) ? '+' : '-',
421 (brc & PCI_BRIDGE_CTL_SERR) ? '+' : '-',
422 (brc & PCI_BRIDGE_CTL_NO_ISA) ? '+' : '-',
423 (brc & PCI_BRIDGE_CTL_VGA) ? '+' : '-',
424 (brc & PCI_BRIDGE_CTL_MASTER_ABORT) ? '+' : '-',
425 (brc & PCI_BRIDGE_CTL_BUS_RESET) ? '+' : '-',
426 (brc & PCI_BRIDGE_CTL_FAST_BACK) ? '+' : '-');
430 show_htype2(struct device *d)
435 show_verbose(struct device *d)
437 word status = get_conf_word(d, PCI_STATUS);
438 word cmd = get_conf_word(d, PCI_COMMAND);
439 word class = get_conf_word(d, PCI_CLASS_DEVICE);
440 byte bist = get_conf_byte(d, PCI_BIST);
441 byte htype = get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f;
442 byte latency = get_conf_byte(d, PCI_LATENCY_TIMER);
443 byte cache_line = get_conf_byte(d, PCI_CACHE_LINE_SIZE);
444 byte max_lat, min_gnt;
445 byte int_pin = get_conf_byte(d, PCI_INTERRUPT_PIN);
446 byte int_line = get_conf_byte(d, PCI_INTERRUPT_LINE);
448 word subsys_v, subsys_d;
454 case PCI_HEADER_TYPE_NORMAL:
455 if (class == PCI_CLASS_BRIDGE_PCI)
458 printf("\t!!! Header type %02x doesn't match class code %04x\n", htype, class);
461 max_lat = get_conf_byte(d, PCI_MAX_LAT);
462 min_gnt = get_conf_byte(d, PCI_MIN_GNT);
463 subsys_v = get_conf_word(d, PCI_SUBSYSTEM_VENDOR_ID);
464 subsys_d = get_conf_word(d, PCI_SUBSYSTEM_ID);
466 case PCI_HEADER_TYPE_BRIDGE:
467 if (class != PCI_CLASS_BRIDGE_PCI)
469 irq = int_line = int_pin = min_gnt = max_lat = 0;
470 subsys_v = subsys_d = 0;
472 case PCI_HEADER_TYPE_CARDBUS:
473 if ((class >> 8) != PCI_BASE_CLASS_BRIDGE)
475 irq = int_line = int_pin = min_gnt = max_lat = 0;
476 subsys_v = subsys_d = 0;
479 printf("\t!!! Unknown header type %02x\n", htype);
491 printf("\tSubsystem ID: %04x:%04x\n", subsys_v, subsys_d);
492 printf("\tControl: I/O%c Mem%c BusMaster%c SpecCycle%c MemWINV%c VGASnoop%c ParErr%c Stepping%c SERR%c FastB2B%c\n",
493 (cmd & PCI_COMMAND_IO) ? '+' : '-',
494 (cmd & PCI_COMMAND_MEMORY) ? '+' : '-',
495 (cmd & PCI_COMMAND_MASTER) ? '+' : '-',
496 (cmd & PCI_COMMAND_SPECIAL) ? '+' : '-',
497 (cmd & PCI_COMMAND_INVALIDATE) ? '+' : '-',
498 (cmd & PCI_COMMAND_VGA_PALETTE) ? '+' : '-',
499 (cmd & PCI_COMMAND_PARITY) ? '+' : '-',
500 (cmd & PCI_COMMAND_WAIT) ? '+' : '-',
501 (cmd & PCI_COMMAND_SERR) ? '+' : '-',
502 (cmd & PCI_COMMAND_FAST_BACK) ? '+' : '-');
503 printf("\tStatus: 66Mhz%c UDF%c FastB2B%c ParErr%c DEVSEL=%s >TAbort%c <TAbort%c <MAbort%c >SERR%c <PERR%c\n",
504 (status & PCI_STATUS_66MHZ) ? '+' : '-',
505 (status & PCI_STATUS_UDF) ? '+' : '-',
506 (status & PCI_STATUS_FAST_BACK) ? '+' : '-',
507 (status & PCI_STATUS_PARITY) ? '+' : '-',
508 ((status & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_SLOW) ? "slow" :
509 ((status & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_MEDIUM) ? "medium" :
510 ((status & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_FAST) ? "fast" : "??",
511 (status & PCI_STATUS_SIG_TARGET_ABORT) ? '+' : '-',
512 (status & PCI_STATUS_REC_TARGET_ABORT) ? '+' : '-',
513 (status & PCI_STATUS_REC_MASTER_ABORT) ? '+' : '-',
514 (status & PCI_STATUS_SIG_SYSTEM_ERROR) ? '+' : '-',
515 (status & PCI_STATUS_DETECTED_PARITY) ? '+' : '-');
516 if (cmd & PCI_COMMAND_MASTER)
518 printf("\tLatency: ");
520 printf("%d min, ", min_gnt);
522 printf("%d max, ", max_lat);
523 printf("%d set", latency);
525 printf(", cache line size %02x", cache_line);
529 printf("\tInterrupt: pin %c routed to IRQ " IRQ_FORMAT "\n", 'A' + int_pin - 1, irq);
534 if (cmd & PCI_COMMAND_MASTER)
535 printf("bus master, ");
536 if (cmd & PCI_COMMAND_VGA_PALETTE)
537 printf("VGA palette snoop, ");
538 if (cmd & PCI_COMMAND_WAIT)
539 printf("stepping, ");
540 if (cmd & PCI_COMMAND_FAST_BACK)
541 printf("fast Back2Back, ");
542 if (status & PCI_STATUS_66MHZ)
544 if (status & PCI_STATUS_UDF)
545 printf("user-definable features, ");
547 ((status & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_SLOW) ? "slow" :
548 ((status & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_MEDIUM) ? "medium" :
549 ((status & PCI_STATUS_DEVSEL_MASK) == PCI_STATUS_DEVSEL_FAST) ? "fast" : "??");
550 if (cmd & PCI_COMMAND_MASTER)
551 printf(", latency %d", latency);
554 printf(", IRQ " IRQ_FORMAT, irq);
560 if (bist & PCI_BIST_CAPABLE)
562 if (bist & PCI_BIST_START)
563 printf("\tBIST is running\n");
565 printf("\tBIST result: %02x\n", bist & PCI_BIST_CODE_MASK);
570 case PCI_HEADER_TYPE_NORMAL:
573 case PCI_HEADER_TYPE_BRIDGE:
576 case PCI_HEADER_TYPE_CARDBUS:
583 show_hex_dump(struct device *d)
586 int limit = (show_hex > 1) ? 256 : 64;
588 for(i=0; i<limit; i++)
592 printf(" %02x", get_conf_byte(d, i));
599 show_machine(struct device *d)
605 printf("Device:\t%02x:%02x.%x\n", d->bus, PCI_SLOT(d->devfn), PCI_FUNC(d->devfn));
606 printf("Class:\t%s\n", lookup_class(get_conf_word(d, PCI_CLASS_DEVICE)));
607 printf("Vendor:\t%s\n", lookup_vendor(d->vendid));
608 printf("Device:\t%s\n", lookup_device(d->vendid, d->devid));
609 if (c = get_conf_byte(d, PCI_REVISION_ID))
610 printf("Rev:\t%02x\n", c);
611 if (c = get_conf_byte(d, PCI_CLASS_PROG))
612 printf("ProgIf:\t%02x\n", c);
616 printf("%02x:%02x.%x ", d->bus, PCI_SLOT(d->devfn), PCI_FUNC(d->devfn));
617 printf("\"%s\" \"%s\" \"%s\"",
618 lookup_class(get_conf_word(d, PCI_CLASS_DEVICE)),
619 lookup_vendor(d->vendid),
620 lookup_device(d->vendid, d->devid));
621 if (c = get_conf_byte(d, PCI_REVISION_ID))
622 printf(" -r%02x", c);
623 if (c = get_conf_byte(d, PCI_CLASS_PROG))
624 printf(" -p%02x", c);
634 for(d=first_dev; d; d=d->next)
636 if (machine_readable)
644 if (verbose || show_hex)
652 struct bridge *chain; /* Single-linked list of bridges */
653 struct bridge *next, *child; /* Tree of bridges */
654 struct bus *first_bus; /* List of busses connected to this bridge */
655 unsigned int primary, secondary, subordinate; /* Bus numbers */
656 struct device *br_dev;
662 struct device *first_dev, **last_dev;
665 static struct bridge host_bridge = { NULL, NULL, NULL, NULL, ~0, 0, ~0, NULL };
668 find_bus(struct bridge *b, unsigned int n)
672 for(bus=b->first_bus; bus; bus=bus->sibling)
673 if (bus->number == n)
679 new_bus(struct bridge *b, unsigned int n)
681 struct bus *bus = xmalloc(sizeof(struct bus));
683 bus = xmalloc(sizeof(struct bus));
685 bus->sibling = b->first_bus;
686 bus->first_dev = NULL;
687 bus->last_dev = &bus->first_dev;
693 insert_dev(struct device *d, struct bridge *b)
697 if (! (bus = find_bus(b, d->bus)))
700 for(c=b->child; c; c=c->next)
701 if (c->secondary <= d->bus && d->bus <= c->subordinate)
702 return insert_dev(d, c);
703 bus = new_bus(b, d->bus);
705 /* Simple insertion at the end _does_ guarantee the correct order as the
706 * original device list was sorted by (bus, devfn) lexicographically
707 * and all devices on the new list have the same bus number.
710 bus->last_dev = &d->next;
717 struct device *d, *d2;
718 struct bridge **last_br, *b;
720 /* Build list of bridges */
722 last_br = &host_bridge.chain;
723 for(d=first_dev; d; d=d->next)
725 word class = get_conf_word(d, PCI_CLASS_DEVICE);
726 if (class == PCI_CLASS_BRIDGE_PCI && (get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f) == 1)
728 b = xmalloc(sizeof(struct bridge));
729 b->primary = get_conf_byte(d, PCI_PRIMARY_BUS);
730 b->secondary = get_conf_byte(d, PCI_SECONDARY_BUS);
731 b->subordinate = get_conf_byte(d, PCI_SUBORDINATE_BUS);
734 b->next = b->child = NULL;
741 /* Create a bridge tree */
743 for(b=&host_bridge; b; b=b->chain)
745 struct bridge *c, *best;
747 for(c=&host_bridge; c; c=c->chain)
748 if (c != b && b->primary >= c->secondary && b->primary <= c->subordinate &&
749 (!best || best->subordinate - best->primary > c->subordinate - c->primary))
753 b->next = best->child;
758 /* Insert secondary bus for each bridge */
760 for(b=&host_bridge; b; b=b->chain)
761 if (!find_bus(b, b->secondary))
762 new_bus(b, b->secondary);
764 /* Create bus structs and link devices */
769 insert_dev(d, &host_bridge);
775 print_it(byte *line, byte *p)
781 if (*p == '+' || *p == '|')
787 static void show_tree_bridge(struct bridge *, byte *, byte *);
790 show_tree_dev(struct device *d, byte *line, byte *p)
794 p += sprintf(p, "%02x.%x", PCI_SLOT(d->devfn), PCI_FUNC(d->devfn));
795 for(b=&host_bridge; b; b=b->chain)
798 if (b->secondary == b->subordinate)
799 p += sprintf(p, "-[%02x]-", b->secondary);
801 p += sprintf(p, "-[%02x-%02x]-", b->secondary, b->subordinate);
802 show_tree_bridge(b, line, p);
806 p += sprintf(p, " %s", lookup_device_full(d->vendid, d->devid));
811 show_tree_bus(struct bus *b, byte *line, byte *p)
815 else if (!b->first_dev->next)
819 show_tree_dev(b->first_dev, line, p);
823 struct device *d = b->first_dev;
828 show_tree_dev(d, line, p+2);
833 show_tree_dev(d, line, p+2);
838 show_tree_bridge(struct bridge *b, byte *line, byte *p)
841 if (!b->first_bus->sibling)
843 if (b == &host_bridge)
844 p += sprintf(p, "[%02x]-", b->first_bus->number);
845 show_tree_bus(b->first_bus, line, p);
849 struct bus *u = b->first_bus;
854 k = p + sprintf(p, "+-[%02x]-", u->number);
855 show_tree_bus(u, line, k);
858 k = p + sprintf(p, "\\-[%02x]-", u->number);
859 show_tree_bus(u, line, k);
869 show_tree_bridge(&host_bridge, line, line);
875 main(int argc, char **argv)
879 while ((i = getopt(argc, argv, options)) != -1)
883 show_numeric_ids = 1;
892 bus_filter = strtol(optarg, NULL, 16);
895 slot_filter = strtol(optarg, NULL, 16);
898 func_filter = strtol(optarg, NULL, 16);
901 vend_filter = strtol(optarg, NULL, 16);
904 dev_filter = strtol(optarg, NULL, 16);
923 fprintf(stderr, help_msg);