package pci-db

  1. Overview
  2. Docs
Library to parse and query the pci.ids database of PCI devices

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.3.0.tar.gz
sha256=9676fde7484d0a47dc96b1ead6cfccb57fc9e29e5f73750cd7e667cb8118e0bb
md5=a70d017e2a0e7782e0473e16c45f5aa7

doc/src/pci-db/pci_db_types.ml.html

Source file pci_db_types.ml

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
module Id = struct
	type t =
		| CLASS_ID of int64
		| SUBCLASS_ID of int64
		| PROGIF_ID of int64
		| VENDOR_ID of int64
		| DEVICE_ID of int64
		| SUBDEVICE_ID of int64 * int64
	let to_string = function
		| CLASS_ID x | SUBCLASS_ID x | PROGIF_ID x -> Printf.sprintf "%02Lx" x
		| VENDOR_ID x | DEVICE_ID x -> Printf.sprintf "%04Lx" x
		| SUBDEVICE_ID (x, y) -> Printf.sprintf "%04Lx %04Lx" x y
	let compare = compare
end

module IdMap = Map.Make(Id)

type progif = {
	pi_name : string;
}

type subclass = {
	sc_name : string;
	progifs : progif IdMap.t;
}
type classs = {
	c_name : string;
	subclasses : subclass IdMap.t;
}

type subdevice = {
	sd_name : string;
}

type device = {
	d_name : string;
	subdevices : subdevice IdMap.t;
}

type vendor = {
	v_name : string;
	devices : device IdMap.t;
}

type t = {
	classes: classs IdMap.t;
	vendors: vendor IdMap.t;
}