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,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;
}