mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Implement acpi_pci_X_cfg_Y using HalXBusDataByOffset()
svn path=/trunk/; revision=18688
This commit is contained in:
parent
5f32912b73
commit
7b786e95e7
1 changed files with 123 additions and 18 deletions
|
@ -354,10 +354,27 @@ acpi_os_read_pci_cfg_byte(
|
|||
u32 addr,
|
||||
u8 * val)
|
||||
{
|
||||
/* FIXME: What do we do here? */
|
||||
NTSTATUS ret;
|
||||
PCI_SLOT_NUMBER slot;
|
||||
|
||||
DPRINT("acpi_os_read_pci_cfg_byte is not implemented");
|
||||
if (func == 0)
|
||||
return AE_ERROR;
|
||||
|
||||
slot.u.AsULONG = 0;
|
||||
slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF;
|
||||
slot.u.bits.FunctionNumber = func & 0xFFFF;
|
||||
|
||||
DPRINT("acpi_os_read_pci_cfg_byte, slot=0x%X, func=0x%X\n", slot.u.AsULONG, func);
|
||||
ret = HalGetBusDataByOffset(PCIConfiguration,
|
||||
bus,
|
||||
slot.u.AsULONG,
|
||||
val,
|
||||
addr,
|
||||
sizeof(UCHAR));
|
||||
|
||||
if (NT_SUCCESS(ret))
|
||||
return AE_OK;
|
||||
else
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
|
@ -368,10 +385,27 @@ acpi_os_read_pci_cfg_word(
|
|||
u32 addr,
|
||||
u16 * val)
|
||||
{
|
||||
/* FIXME: What do we do here? */
|
||||
NTSTATUS ret;
|
||||
PCI_SLOT_NUMBER slot;
|
||||
|
||||
DPRINT("acpi_os_read_pci_cfg_word is not implemented");
|
||||
if (func == 0)
|
||||
return AE_ERROR;
|
||||
|
||||
slot.u.AsULONG = 0;
|
||||
slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF;
|
||||
slot.u.bits.FunctionNumber = func & 0xFFFF;
|
||||
|
||||
DPRINT("acpi_os_read_pci_cfg_word, slot=0x%x\n", slot.u.AsULONG);
|
||||
ret = HalGetBusDataByOffset(PCIConfiguration,
|
||||
bus,
|
||||
slot.u.AsULONG,
|
||||
val,
|
||||
addr,
|
||||
sizeof(USHORT));
|
||||
|
||||
if (NT_SUCCESS(ret))
|
||||
return AE_OK;
|
||||
else
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
|
@ -382,10 +416,27 @@ acpi_os_read_pci_cfg_dword(
|
|||
u32 addr,
|
||||
u32 * val)
|
||||
{
|
||||
/* FIXME: What do we do here? */
|
||||
NTSTATUS ret;
|
||||
PCI_SLOT_NUMBER slot;
|
||||
|
||||
DPRINT("acpi_os_read_pci_cfg_dword is not implemented");
|
||||
if (func == 0)
|
||||
return AE_ERROR;
|
||||
|
||||
slot.u.AsULONG = 0;
|
||||
slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF;
|
||||
slot.u.bits.FunctionNumber = func & 0xFFFF;
|
||||
|
||||
DPRINT("acpi_os_read_pci_cfg_dword, slot=0x%x\n", slot.u.AsULONG);
|
||||
ret = HalGetBusDataByOffset(PCIConfiguration,
|
||||
bus,
|
||||
slot.u.AsULONG,
|
||||
val,
|
||||
addr,
|
||||
sizeof(ULONG));
|
||||
|
||||
if (NT_SUCCESS(ret))
|
||||
return AE_OK;
|
||||
else
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
|
@ -396,10 +447,28 @@ acpi_os_write_pci_cfg_byte(
|
|||
u32 addr,
|
||||
u8 val)
|
||||
{
|
||||
/* FIXME: What do we do here? */
|
||||
NTSTATUS ret;
|
||||
UCHAR buf = val;
|
||||
PCI_SLOT_NUMBER slot;
|
||||
|
||||
DPRINT("acpi_os_write_pci_cfg_byte is not implemented");
|
||||
if (func == 0)
|
||||
return AE_ERROR;
|
||||
|
||||
slot.u.AsULONG = 0;
|
||||
slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF;
|
||||
slot.u.bits.FunctionNumber = func & 0xFFFF;
|
||||
|
||||
DPRINT("acpi_os_write_pci_cfg_byte, slot=0x%x\n", slot.u.AsULONG);
|
||||
ret = HalSetBusDataByOffset(PCIConfiguration,
|
||||
bus,
|
||||
slot.u.AsULONG,
|
||||
&buf,
|
||||
addr,
|
||||
sizeof(UCHAR));
|
||||
|
||||
if (NT_SUCCESS(ret))
|
||||
return AE_OK;
|
||||
else
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
|
@ -410,10 +479,28 @@ acpi_os_write_pci_cfg_word(
|
|||
u32 addr,
|
||||
u16 val)
|
||||
{
|
||||
/* FIXME: What do we do here? */
|
||||
NTSTATUS ret;
|
||||
USHORT buf = val;
|
||||
PCI_SLOT_NUMBER slot;
|
||||
|
||||
DPRINT("acpi_os_write_pci_cfg_word is not implemented");
|
||||
if (func == 0)
|
||||
return AE_ERROR;
|
||||
|
||||
slot.u.AsULONG = 0;
|
||||
slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF;
|
||||
slot.u.bits.FunctionNumber = func & 0xFFFF;
|
||||
|
||||
DPRINT("acpi_os_write_pci_cfg_byte, slot=0x%x\n", slot.u.AsULONG);
|
||||
ret = HalSetBusDataByOffset(PCIConfiguration,
|
||||
bus,
|
||||
slot.u.AsULONG,
|
||||
&buf,
|
||||
addr,
|
||||
sizeof(USHORT));
|
||||
|
||||
if (NT_SUCCESS(ret))
|
||||
return AE_OK;
|
||||
else
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
|
@ -424,10 +511,28 @@ acpi_os_write_pci_cfg_dword(
|
|||
u32 addr,
|
||||
u32 val)
|
||||
{
|
||||
/* FIXME: What do we do here? */
|
||||
NTSTATUS ret;
|
||||
ULONG buf = val;
|
||||
PCI_SLOT_NUMBER slot;
|
||||
|
||||
DPRINT("acpi_os_write_pci_cfg_dword is not implemented");
|
||||
if (func == 0)
|
||||
return AE_ERROR;
|
||||
|
||||
slot.u.AsULONG = 0;
|
||||
slot.u.bits.DeviceNumber = (func >> 16) & 0xFFFF;
|
||||
slot.u.bits.FunctionNumber = func & 0xFFFF;
|
||||
|
||||
DPRINT("acpi_os_write_pci_cfg_byte, slot=0x%x\n", slot.u.AsULONG);
|
||||
ret = HalSetBusDataByOffset(PCIConfiguration,
|
||||
bus,
|
||||
slot.u.AsULONG,
|
||||
&buf,
|
||||
addr,
|
||||
sizeof(ULONG));
|
||||
|
||||
if (NT_SUCCESS(ret))
|
||||
return AE_OK;
|
||||
else
|
||||
return AE_ERROR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue