mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
Kernel: Rename two PCI components
Rename ID => HardwareID, and PhysicalID => DeviceIdentifier. This change merely does that to clarify what these objects really are.
This commit is contained in:
parent
82bb08a15c
commit
da327746a2
26 changed files with 97 additions and 97 deletions
|
@ -182,7 +182,7 @@ static bool is_valid_device_id(u16 device_id)
|
|||
|
||||
UNMAP_AFTER_INIT RefPtr<E1000ENetworkAdapter> E1000ENetworkAdapter::try_to_initialize(PCI::Address address)
|
||||
{
|
||||
auto id = PCI::get_id(address);
|
||||
auto id = PCI::get_hardware_id(address);
|
||||
if (id.vendor_id != PCI::VendorID::Intel)
|
||||
return {};
|
||||
if (!is_valid_device_id(id.device_id))
|
||||
|
|
|
@ -160,7 +160,7 @@ UNMAP_AFTER_INIT static bool is_valid_device_id(u16 device_id)
|
|||
|
||||
UNMAP_AFTER_INIT RefPtr<E1000NetworkAdapter> E1000NetworkAdapter::try_to_initialize(PCI::Address address)
|
||||
{
|
||||
auto id = PCI::get_id(address);
|
||||
auto id = PCI::get_hardware_id(address);
|
||||
if (id.vendor_id != PCI::VendorID::Intel)
|
||||
return {};
|
||||
if (!is_valid_device_id(id.device_id))
|
||||
|
|
|
@ -140,21 +140,21 @@ struct [[gnu::packed]] received_packet_header {
|
|||
UNMAP_AFTER_INIT RefPtr<NE2000NetworkAdapter> NE2000NetworkAdapter::try_to_initialize(PCI::Address address)
|
||||
{
|
||||
constexpr auto ne2k_ids = Array {
|
||||
PCI::ID { 0x10EC, 0x8029 }, // RealTek RTL-8029(AS)
|
||||
PCI::HardwareID { 0x10EC, 0x8029 }, // RealTek RTL-8029(AS)
|
||||
|
||||
// List of clones, taken from Linux's ne2k-pci.c
|
||||
PCI::ID { 0x1050, 0x0940 }, // Winbond 89C940
|
||||
PCI::ID { 0x11f6, 0x1401 }, // Compex RL2000
|
||||
PCI::ID { 0x8e2e, 0x3000 }, // KTI ET32P2
|
||||
PCI::ID { 0x4a14, 0x5000 }, // NetVin NV5000SC
|
||||
PCI::ID { 0x1106, 0x0926 }, // Via 86C926
|
||||
PCI::ID { 0x10bd, 0x0e34 }, // SureCom NE34
|
||||
PCI::ID { 0x1050, 0x5a5a }, // Winbond W89C940F
|
||||
PCI::ID { 0x12c3, 0x0058 }, // Holtek HT80232
|
||||
PCI::ID { 0x12c3, 0x5598 }, // Holtek HT80229
|
||||
PCI::ID { 0x8c4a, 0x1980 }, // Winbond W89C940 (misprogrammed)
|
||||
PCI::HardwareID { 0x1050, 0x0940 }, // Winbond 89C940
|
||||
PCI::HardwareID { 0x11f6, 0x1401 }, // Compex RL2000
|
||||
PCI::HardwareID { 0x8e2e, 0x3000 }, // KTI ET32P2
|
||||
PCI::HardwareID { 0x4a14, 0x5000 }, // NetVin NV5000SC
|
||||
PCI::HardwareID { 0x1106, 0x0926 }, // Via 86C926
|
||||
PCI::HardwareID { 0x10bd, 0x0e34 }, // SureCom NE34
|
||||
PCI::HardwareID { 0x1050, 0x5a5a }, // Winbond W89C940F
|
||||
PCI::HardwareID { 0x12c3, 0x0058 }, // Holtek HT80232
|
||||
PCI::HardwareID { 0x12c3, 0x5598 }, // Holtek HT80229
|
||||
PCI::HardwareID { 0x8c4a, 0x1980 }, // Winbond W89C940 (misprogrammed)
|
||||
};
|
||||
auto id = PCI::get_id(address);
|
||||
auto id = PCI::get_hardware_id(address);
|
||||
if (!ne2k_ids.span().contains_slow(id))
|
||||
return {};
|
||||
u8 irq = PCI::get_interrupt_line(address);
|
||||
|
|
|
@ -91,9 +91,9 @@ UNMAP_AFTER_INIT RefPtr<NetworkAdapter> NetworkingManagement::determine_network_
|
|||
bool NetworkingManagement::initialize()
|
||||
{
|
||||
if (!kernel_command_line().is_physical_networking_disabled()) {
|
||||
PCI::enumerate([&](const PCI::Address& address, PCI::PhysicalID const& physical_id) {
|
||||
PCI::enumerate([&](const PCI::Address& address, PCI::DeviceIdentifier const& device_identifier) {
|
||||
// Note: PCI class 2 is the class of Network devices
|
||||
if (physical_id.class_code().value() != 0x02)
|
||||
if (device_identifier.class_code().value() != 0x02)
|
||||
return;
|
||||
if (auto adapter = determine_network_device(address); !adapter.is_null())
|
||||
m_adapters.append(adapter.release_nonnull());
|
||||
|
|
|
@ -114,8 +114,8 @@ namespace Kernel {
|
|||
|
||||
UNMAP_AFTER_INIT RefPtr<RTL8139NetworkAdapter> RTL8139NetworkAdapter::try_to_initialize(PCI::Address address)
|
||||
{
|
||||
constexpr PCI::ID rtl8139_id = { 0x10EC, 0x8139 };
|
||||
auto id = PCI::get_id(address);
|
||||
constexpr PCI::HardwareID rtl8139_id = { 0x10EC, 0x8139 };
|
||||
auto id = PCI::get_hardware_id(address);
|
||||
if (id != rtl8139_id)
|
||||
return {};
|
||||
u8 irq = PCI::get_interrupt_line(address);
|
||||
|
|
|
@ -183,7 +183,7 @@ namespace Kernel {
|
|||
|
||||
UNMAP_AFTER_INIT RefPtr<RTL8168NetworkAdapter> RTL8168NetworkAdapter::try_to_initialize(PCI::Address address)
|
||||
{
|
||||
auto id = PCI::get_id(address);
|
||||
auto id = PCI::get_hardware_id(address);
|
||||
if (id.vendor_id != PCI::VendorID::Realtek)
|
||||
return {};
|
||||
if (id.device_id != 0x8168)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue