Implement acpi_pci_X_cfg_Y using HalXBusDataByOffset()

svn path=/trunk/; revision=18688
This commit is contained in:
Aleksey Bragin 2005-10-22 20:03:50 +00:00
parent 5f32912b73
commit 7b786e95e7

View file

@ -354,11 +354,28 @@ 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;
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;
}
ACPI_STATUS
@ -368,11 +385,28 @@ 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;
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;
}
ACPI_STATUS
@ -382,11 +416,28 @@ 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;
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;
}
ACPI_STATUS
@ -396,11 +447,29 @@ 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;
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;
}
ACPI_STATUS
@ -410,11 +479,29 @@ 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;
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;
}
ACPI_STATUS
@ -424,11 +511,29 @@ 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;
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;
}
ACPI_STATUS