]> mj.ucw.cz Git - pciutils.git/blob - pciutils.h
d7fab9036b1dfb5b22feed3b40bc1edf182a0383
[pciutils.git] / pciutils.h
1 /*
2  *      $Id: pciutils.h,v 1.4 1998/03/31 21:02:18 mj Exp $
3  *
4  *      Linux PCI Utilities -- Declarations
5  *
6  *      Copyright (c) 1997, 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
7  *
8  *      Can be freely distributed and used under the terms of the GNU GPL.
9  */
10
11 #include <linux/types.h>
12
13 #ifdef KERNEL_PCI_H
14 #include <linux/pci.h>
15 #else
16 #include "pci.h"
17 #endif
18
19 #define PROC_BUS_PCI "/proc/bus/pci"
20 #define ETC_PCI_IDS "/etc/pci.ids"
21
22 /* Types */
23
24 typedef __u8 byte;
25 typedef __u16 word;
26 typedef __u32 u32;
27
28 /* lspci.c */
29
30 void *xmalloc(unsigned int);
31
32 /* names.c */
33
34 extern int show_numeric_ids;
35 extern char *pci_ids;
36
37 char *lookup_vendor(word);
38 char *lookup_device(word, word);
39 char *lookup_device_full(word, word);
40 char *lookup_class(word);
41
42 /* filter.c */
43
44 struct pci_filter {
45   int bus, slot, func;                  /* -1 = ANY */
46   int vendor, device;
47 };
48
49 void filter_init(struct pci_filter *);
50 char *filter_parse_slot(struct pci_filter *, char *);
51 char *filter_parse_id(struct pci_filter *, char *);
52 int filter_match(struct pci_filter *, byte bus, byte devfn, word vendid, word devid);