Modules:core/pci
From Go-OS
Contents |
Module info
The core/pci module is responsible for enumerating PCI devices and keeping track of assigned drivers. Per-device driver assignation should move back to kernel, and will be made generic (and to allow usage of same API for PCI, USB and other devices).
This module exports some functions to make life of other modules easier.
[1:0xc0079ff8] core/pci (Core PCI driver) at 0xc0078000=>0xc007a058 (bss: 0xd0041000=>0xd0041004) * fetch_pci_devices(0xc00780c8) * pci_register_driver(0xc00780a8) * pci_get_driven_device(0xc00789b8)
Available functions
#include <kmod/core/pci.h>
fetch_pci_devices
struct pci_vendor *fetch_pci_devices();
Returns a pointer to an array of pci_vendor. Each pci_vendor has a pointer to its first pci_device. Each pci_device has a pointer to the "next" device.
pci_register_driver
bool pci_register_driver(struct pci_device *dev, struct kernel_module_info *module_info);
Register given module as being a driver for the given pci_device. The function will fail if this device already has a driver.
pci_get_driven_device
void *pci_get_driven_device(uint16_t type);
Returns a pointer to a pci_device for a driven device of a given type. "Driven device" means the device has a driver attached.