1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

Kernel: More work on bringing up E1000 support.

This commit is contained in:
Andreas Kling 2019-03-11 11:11:29 +01:00
parent a36eaeb18c
commit 47b096feb4
4 changed files with 15 additions and 0 deletions

View file

@ -103,6 +103,14 @@ dword get_BAR3(Address address) { return read_field<dword>(address, PCI_BAR3); }
dword get_BAR4(Address address) { return read_field<dword>(address, PCI_BAR4); }
dword get_BAR5(Address address) { return read_field<dword>(address, PCI_BAR5); }
void enable_bus_mastering(Address address)
{
auto value = read_field<word>(address, PCI_COMMAND);
value |= (1 << 2);
value |= (1 << 0);
write_field<word>(address, PCI_COMMAND, value);
}
void enumerate_all(Function<void(Address, ID)> callback)
{
// Single PCI host controller.