FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
pci_id.h
Go to the documentation of this file.
1
11
12#ifndef PCI_ID_H
13#define PCI_ID_H
14
15#include <basics.h>
16
17#define MAX_PCI_DEVICES 512
18
19typedef void (*pci_probe_fn)(uint8_t bus, uint8_t slot, uint8_t function);
20
21typedef struct {
22 uint16_t vendor;
23 uint16_t device;
24 uint8_t classid; // 0xFF = ignore
25 const char* name;
26 uint8_t is_gpu;
27 pci_probe_fn probe; // optional device-specific init
29
36string parse_vendor(int16 vendor);
37
44string parse_class(int16 classid);
45
54const pci_id_entry_t* pci_lookup(uint16_t vendor, uint16_t device, uint8_t classid);
55
63void probe_ahci(uint8_t bus, uint8_t slot, uint8_t function);
64
72void probe_rtl8139(uint8_t bus, uint8_t slot, uint8_t function);
73
81cstring auto_name_gpu(uint16_t vendor, uint16_t device);
82
83#endif
This is a basic header files with FrostWing specific short forms and basically a good for life header...
void probe_rtl8139(uint8_t bus, uint8_t slot, uint8_t function)
Finds the RTL8139 card and handles it.
string parse_class(int16 classid)
Gets the class id and gives the appropriate class name.
cstring auto_name_gpu(uint16_t vendor, uint16_t device)
Automatically names the unknown GPU with vendor name and its device id.
const pci_id_entry_t * pci_lookup(uint16_t vendor, uint16_t device, uint8_t classid)
A Simplified and clean PCI lookup function.
void probe_ahci(uint8_t bus, uint8_t slot, uint8_t function)
Finds the AHCI BAR and handles it.
string parse_vendor(int16 vendor)
Gets the vendor id and gives the appropriate name.
Definition pci_id.h:21