PCI_x86: remove
Change-Id: I54335b6390dc5e312225a3100fd88d4e49838d35 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6331 Reviewed-by: Fredrik Holmqvist <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
2982f45075
commit
bd7bb43761
@@ -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 <SupportDefs.h>
|
||||
#include <module.h>
|
||||
|
||||
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
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
|
||||
#include <PCI.h>
|
||||
#include <PCI_x86.h>
|
||||
#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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user