UEFIStarter
a simple UEFI framework
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pci.h
Go to the documentation of this file.
1 
11 #ifndef __PCI_H
12 #define __PCI_H
13 
14 #include <Uefi.h>
15 #include <Protocol/PciIo.h>
16 #include <IndustryStandard/Pci.h>
17 #include "core/logger.h"
18 
19 
21 typedef struct
22 {
23  UINT8 subclass_code;
24  UINT16 *subclass_name;
26 
28 typedef struct
29 {
30  UINT8 class_code;
31  UINT16 *class_name;
34 
35 
36 CHAR16 *find_pci_device_name(UINT16 vendor_id, UINT16 device_id, UINT16 subvendor_id, UINT16 subdevice_id);
37 CHAR16 *find_pci_class_name(UINT8 class_code[3]);
38 void print_pci_devices();
40 EFI_PCI_IO_PROTOCOL *find_pci_device(UINT16 vendor_id, UINT16 device_id);
41 
42 //call before using PCI library
43 void init_pci_lib();
44 
45 //call whenever PCI library is used (currently frees device ID file buffer)
46 void shutdown_pci_lib();
47 
48 #endif
pci_subclass_name_t * subclasses
the class&#39;s subclasses
Definition: pci.h:32
data type for PCI device class names
Definition: pci.h:28
CHAR16 * find_pci_class_name(UINT8 class_code[3])
Finds a PCI class and subclass name by 3-byte class code.
Definition: pci.c:235
UINT16 * class_name
the class&#39;s name, as UTF-16
Definition: pci.h:31
UINT8 subclass_code
the subclass&#39;s code
Definition: pci.h:23
void print_known_pci_classes()
Prints a list of known PCI classes and subclasses.
Definition: pci.c:381
data type for PCI device subclass names
Definition: pci.h:21
void print_pci_devices()
Prints a short description of all connected PCI devices.
Definition: pci.c:363
EFI_PCI_IO_PROTOCOL * find_pci_device(UINT16 vendor_id, UINT16 device_id)
Fetches a PCI device&#39;s protocol handle.
Definition: pci.c:345
UINT8 class_code
the class&#39;s code
Definition: pci.h:30
void shutdown_pci_lib()
Shuts down the PCI library.
Definition: pci.c:418
void init_pci_lib()
Initializes the PCI library.
Definition: pci.c:408
UINT16 * subclass_name
the subclass&#39;s name, as UTF-16
Definition: pci.h:24
Logging facility, supports verbosity levels.
CHAR16 * find_pci_device_name(UINT16 vendor_id, UINT16 device_id, UINT16 subvendor_id, UINT16 subdevice_id)
Looks up a PCI device&#39;s name by vendor ID and device ID.
Definition: pci.c:151