mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[PCI]
- Fix the Vector value of the interrupt resource - Actually set the device to use the interrupt that the PnP manager gave us svn path=/trunk/; revision=46687
This commit is contained in:
parent
d214e12390
commit
3d1eaacc72
1 changed files with 47 additions and 1 deletions
|
@ -775,7 +775,7 @@ PdoQueryResources(
|
||||||
Descriptor->ShareDisposition = CmResourceShareShared;
|
Descriptor->ShareDisposition = CmResourceShareShared;
|
||||||
Descriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
|
Descriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
|
||||||
Descriptor->u.Interrupt.Level = PciConfig.u.type0.InterruptLine;
|
Descriptor->u.Interrupt.Level = PciConfig.u.type0.InterruptLine;
|
||||||
Descriptor->u.Interrupt.Vector = 0;
|
Descriptor->u.Interrupt.Vector = PciConfig.u.type0.InterruptLine;
|
||||||
Descriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
|
Descriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1186,6 +1186,49 @@ PdoQueryInterface(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static NTSTATUS
|
||||||
|
PdoStartDevice(
|
||||||
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
IN PIRP Irp,
|
||||||
|
PIO_STACK_LOCATION IrpSp)
|
||||||
|
{
|
||||||
|
PCM_RESOURCE_LIST RawResList = IrpSp->Parameters.StartDevice.AllocatedResources;
|
||||||
|
PCM_FULL_RESOURCE_DESCRIPTOR RawFullDesc;
|
||||||
|
PCM_PARTIAL_RESOURCE_DESCRIPTOR RawPartialDesc;
|
||||||
|
ULONG i, ii;
|
||||||
|
PPDO_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
|
UCHAR Irq;
|
||||||
|
|
||||||
|
/* TODO: Assign the other resources we get to the card */
|
||||||
|
|
||||||
|
for (i = 0; i < RawResList->Count; i++)
|
||||||
|
{
|
||||||
|
RawFullDesc = &RawResList->List[i];
|
||||||
|
|
||||||
|
for (ii = 0; ii < RawFullDesc->PartialResourceList.Count; ii++)
|
||||||
|
{
|
||||||
|
RawPartialDesc = &RawFullDesc->PartialResourceList.PartialDescriptors[ii];
|
||||||
|
|
||||||
|
if (RawPartialDesc->Type == CmResourceTypeInterrupt)
|
||||||
|
{
|
||||||
|
DPRINT1("Assigning IRQ %x to PCI device (%x, %x)\n",
|
||||||
|
RawPartialDesc->u.Interrupt.Vector,
|
||||||
|
DeviceExtension->PciDevice->SlotNumber.u.AsULONG,
|
||||||
|
DeviceExtension->PciDevice->BusNumber);
|
||||||
|
|
||||||
|
Irq = (UCHAR)RawPartialDesc->u.Interrupt.Vector;
|
||||||
|
HalSetBusDataByOffset(PCIConfiguration,
|
||||||
|
DeviceExtension->PciDevice->BusNumber,
|
||||||
|
DeviceExtension->PciDevice->SlotNumber.u.AsULONG,
|
||||||
|
&Irq,
|
||||||
|
0x3c /* PCI_INTERRUPT_LINE */,
|
||||||
|
sizeof(UCHAR));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
PdoReadConfig(
|
PdoReadConfig(
|
||||||
|
@ -1352,6 +1395,9 @@ PdoPnpControl(
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IRP_MN_START_DEVICE:
|
case IRP_MN_START_DEVICE:
|
||||||
|
Status = PdoStartDevice(DeviceObject, Irp, IrpSp);
|
||||||
|
break;
|
||||||
|
|
||||||
case IRP_MN_QUERY_STOP_DEVICE:
|
case IRP_MN_QUERY_STOP_DEVICE:
|
||||||
case IRP_MN_CANCEL_STOP_DEVICE:
|
case IRP_MN_CANCEL_STOP_DEVICE:
|
||||||
case IRP_MN_STOP_DEVICE:
|
case IRP_MN_STOP_DEVICE:
|
||||||
|
|
Loading…
Reference in a new issue