summaryrefslogtreecommitdiffstats
path: root/libldetect.h
blob: 4e9b2d1844153af62450c3874cd4bb558e46ec77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma GCC visibility push(default) 
#ifndef LIBLDETECT
#define LIBLDETECT

/******************************************************************************/
/* pciusb *********************************************************************/
/******************************************************************************/
struct pciusb_entry {
  unsigned short vendor; /* PCI vendor id */
  unsigned short device;

  unsigned short subvendor; /* 0xffff if not probe_type'd or no subid */
  unsigned short subdevice; /* 0xffff if not probe_type'd or no subid */
  unsigned long class_id; /* 0 if not probe_type'd */

  unsigned short pci_domain; /* pci domain id (16 bits wide in libpci) */
  unsigned short pci_bus; /* pci bus id 8 bits wide */
  unsigned short pci_device; /* pci device id 5 bits wide */
  unsigned short pci_function; /* pci function id 3 bits wide */

  char *module;
  char *text;
  char* class;
  int already_found:1;
};
struct pciusb_entries {
  struct pciusb_entry *entries;
  unsigned int nb;
};

extern void pciusb_free(struct pciusb_entries *entries);


/******************************************************************************/
/* pci ************************************************************************/
/******************************************************************************/
extern struct pciusb_entries pci_probe(void);
extern const char *pci_class2text(unsigned long class_id);
extern char *proc_pci_path;

/******************************************************************************/
/* usb ************************************************************************/
/******************************************************************************/
extern struct pciusb_entries usb_probe(void);

struct usb_class_text {
  const char *usb_class_text;
  const char *usb_sub_text;
  const char *usb_prot_text;
};

extern struct usb_class_text usb_class2text(unsigned long class_id);

extern char *proc_usb_path;

/******************************************************************************/
/* dmi ************************************************************************/
/******************************************************************************/
struct dmi_entry {
  char *constraints;
  char *module;
};
struct dmi_entries {
  struct dmi_entry *entries;
  unsigned int nb;
};

extern struct dmi_entries dmi_probe(void);
extern void dmi_entries_free(struct dmi_entries entries);
extern char *dmidecode_file;

#endif
#pragma GCC visibility pop