mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 20:22:55 +00:00
Kernel: Move PCI vendor and device IDs into Kernel/PCI/IDs.h
This commit is contained in:
parent
eaf8fc90e7
commit
bf703ee553
Notes:
sideshowbarker
2024-07-18 19:02:25 +09:00
Author: https://github.com/gunnarbeutner
Commit: bf703ee553
Pull-request: https://github.com/SerenityOS/serenity/pull/6669
Reviewed-by: https://github.com/IdanHo ✅
Reviewed-by: https://github.com/supercomputer7
6 changed files with 27 additions and 12 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <AK/MACAddress.h>
|
||||
#include <Kernel/Debug.h>
|
||||
#include <Kernel/Net/E1000NetworkAdapter.h>
|
||||
#include <Kernel/PCI/IDs.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -117,8 +118,6 @@ namespace Kernel {
|
|||
#define INTERRUPT_TXD_LOW (1 << 15)
|
||||
#define INTERRUPT_SRPD (1 << 16)
|
||||
|
||||
#define PCI_VENDOR_INTEL 0x8086
|
||||
|
||||
// https://www.intel.com/content/dam/doc/manual/pci-pci-x-family-gbe-controllers-software-dev-manual.pdf Section 5.2
|
||||
static bool is_valid_device_id(u16 device_id)
|
||||
{
|
||||
|
@ -162,7 +161,7 @@ UNMAP_AFTER_INIT void E1000NetworkAdapter::detect()
|
|||
PCI::enumerate([&](const PCI::Address& address, PCI::ID id) {
|
||||
if (address.is_null())
|
||||
return;
|
||||
if (id.vendor_id != PCI_VENDOR_INTEL)
|
||||
if (id.vendor_id != (u16)PCIVendorID::Intel)
|
||||
return;
|
||||
if (!is_valid_device_id(id.device_id))
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue