From bd7bb43761ffb4dddb0f7f5c30bd9d659c0c28e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 11 Apr 2023 11:02:58 +0200 Subject: [PATCH] PCI_x86: remove Change-Id: I54335b6390dc5e312225a3100fd88d4e49838d35 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6331 Reviewed-by: Fredrik Holmqvist --- headers/os/drivers/PCI_x86.h | 61 --------------- .../kernel/bus_managers/pci/pci_module.cpp | 76 ------------------- 2 files changed, 137 deletions(-) delete mode 100644 headers/os/drivers/PCI_x86.h diff --git a/headers/os/drivers/PCI_x86.h b/headers/os/drivers/PCI_x86.h deleted file mode 100644 index dd99d476c1..0000000000 --- a/headers/os/drivers/PCI_x86.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010, Haiku Inc. All Rights Reserved. - * Distributed under the terms of the MIT License. - */ -#ifndef PCI_X86_H -#define PCI_X86_H - -// DEPRECATED. Use `pci_module_info` or `pci_device_module_info` instead. - -#include -#include - -typedef struct pci_x86_module_info { - module_info info; - - uint8 (*get_msi_count)( - uint8 bus, /* bus number */ - uint8 device, /* device # on bus */ - uint8 function); /* function # in device */ - - status_t (*configure_msi)( - uint8 bus, /* bus number */ - uint8 device, /* device # on bus */ - uint8 function, /* function # in device */ - uint8 count, /* count of vectors desired */ - uint8 *startVector); /* first configured vector */ - status_t (*unconfigure_msi)( - uint8 bus, /* bus number */ - uint8 device, /* device # on bus */ - uint8 function); /* function # in device */ - - status_t (*enable_msi)( - uint8 bus, /* bus number */ - uint8 device, /* device # on bus */ - uint8 function); /* function # in device */ - status_t (*disable_msi)( - uint8 bus, /* bus number */ - uint8 device, /* device # on bus */ - uint8 function); /* function # in device */ - - uint8 (*get_msix_count)( - uint8 bus, /* bus number */ - uint8 device, /* device # on bus */ - uint8 function); /* function # in device */ - - status_t (*configure_msix)( - uint8 bus, /* bus number */ - uint8 device, /* device # on bus */ - uint8 function, /* function # in device */ - uint8 count, /* count of vectors desired */ - uint8 *startVector); /* first configured vector */ - status_t (*enable_msix)( - uint8 bus, /* bus number */ - uint8 device, /* device # on bus */ - uint8 function); /* function # in device */ - -} pci_x86_module_info; - -#define B_PCI_X86_MODULE_NAME "bus_managers/pci/x86/v1" - -#endif // PCI_X86_H diff --git a/src/add-ons/kernel/bus_managers/pci/pci_module.cpp b/src/add-ons/kernel/bus_managers/pci/pci_module.cpp index 88e5418928..49a8192801 100644 --- a/src/add-ons/kernel/bus_managers/pci/pci_module.cpp +++ b/src/add-ons/kernel/bus_managers/pci/pci_module.cpp @@ -7,7 +7,6 @@ #include -#include #include "pci_msi.h" #include "pci_private.h" @@ -49,29 +48,6 @@ pci_old_module_std_ops(int32 op, ...) } -static int32 -pci_arch_module_std_ops(int32 op, ...) -{ - switch (op) { - case B_MODULE_INIT: - { - module_info *dummy; - status_t result = get_module(B_PCI_MODULE_NAME, &dummy); - if (result != B_OK) - return result; - - return B_OK; - } - - case B_MODULE_UNINIT: - put_module(B_PCI_MODULE_NAME); - return B_OK; - } - - return B_BAD_VALUE; -} - - static status_t ResolveBDF(uint8 virtualBus, uint8 device, uint8 function, PCIDev*& dev) { @@ -161,57 +137,6 @@ static struct pci_module_info sOldPCIModule = { }; -static pci_x86_module_info sPCIArchModule = { - { - B_PCI_X86_MODULE_NAME, - 0, - pci_arch_module_std_ops - }, - .get_msi_count = [](uint8 bus, uint8 device, uint8 function) { - PCIDev* dev; - if (ResolveBDF(bus, device, function, dev) < B_OK) - return (uint8)0; - return gPCI->GetMSICount(dev); - }, - .configure_msi = [](uint8 bus, uint8 device, uint8 function, uint8 count, uint8 *startVector) { - PCIDev* dev; - CHECK_RET(ResolveBDF(bus, device, function, dev)); - return gPCI->ConfigureMSI(dev, count, startVector); - }, - .unconfigure_msi = [](uint8 bus, uint8 device, uint8 function) { - PCIDev* dev; - CHECK_RET(ResolveBDF(bus, device, function, dev)); - return gPCI->UnconfigureMSI(dev); - }, - .enable_msi = [](uint8 bus, uint8 device, uint8 function) { - PCIDev* dev; - CHECK_RET(ResolveBDF(bus, device, function, dev)); - return gPCI->EnableMSI(dev); - }, - .disable_msi = [](uint8 bus, uint8 device, uint8 function) { - PCIDev* dev; - CHECK_RET(ResolveBDF(bus, device, function, dev)); - return gPCI->DisableMSI(dev); - }, - .get_msix_count = [](uint8 bus, uint8 device, uint8 function) { - PCIDev* dev; - if (ResolveBDF(bus, device, function, dev) < B_OK) - return (uint8)0; - return gPCI->GetMSIXCount(dev); - }, - .configure_msix = [](uint8 bus, uint8 device, uint8 function, uint8 count, uint8 *startVector) { - PCIDev* dev; - CHECK_RET(ResolveBDF(bus, device, function, dev)); - return gPCI->ConfigureMSIX(dev, count, startVector); - }, - .enable_msix = [](uint8 bus, uint8 device, uint8 function) { - PCIDev* dev; - CHECK_RET(ResolveBDF(bus, device, function, dev)); - return gPCI->EnableMSIX(dev); - } -}; - - module_dependency module_dependencies[] = { {B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&gDeviceManager}, {} @@ -231,6 +156,5 @@ module_info *modules[] = { (module_info *)&gPCIRootModule, (module_info *)&gPCIDeviceModule, (module_info *)&gPCILegacyDriverModule, - (module_info *)&sPCIArchModule, NULL };