mirror of
https://github.com/reactos/reactos.git
synced 2025-05-16 15:50:24 +00:00
[SCSIPORT]
- Remove some code duplication and fix a bug of copying the same interrupt information twice for a device with 2 interrupts (instead of the info for interrupt 1 then the info for interrupt 2) effectively making initialization fail because the resource allocation code will detect a conflict with itself svn path=/trunk/; revision=49158
This commit is contained in:
parent
b5fef1ffcd
commit
50bca246a8
1 changed files with 3 additions and 28 deletions
|
@ -2216,7 +2216,7 @@ SpiConfigToResource(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
|
|||
}
|
||||
|
||||
/* If we use interrupt(s), copy them */
|
||||
if (Interrupt)
|
||||
while (Interrupt)
|
||||
{
|
||||
ResourceDescriptor->Type = CmResourceTypeInterrupt;
|
||||
|
||||
|
@ -2232,39 +2232,14 @@ SpiConfigToResource(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
|
|||
ResourceDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
|
||||
}
|
||||
|
||||
ResourceDescriptor->u.Interrupt.Level = PortConfig->BusInterruptLevel;
|
||||
ResourceDescriptor->u.Interrupt.Vector = PortConfig->BusInterruptVector;
|
||||
ResourceDescriptor->u.Interrupt.Level = (Interrupt == 2) ? PortConfig->BusInterruptLevel2 : PortConfig->BusInterruptLevel;
|
||||
ResourceDescriptor->u.Interrupt.Vector = (Interrupt == 2) ? PortConfig->BusInterruptVector2 : PortConfig->BusInterruptVector;
|
||||
ResourceDescriptor->u.Interrupt.Affinity = 0;
|
||||
|
||||
ResourceDescriptor++;
|
||||
Interrupt--;
|
||||
}
|
||||
|
||||
/* Copy 2nd interrupt
|
||||
FIXME: Stupid code duplication, remove */
|
||||
if (Interrupt)
|
||||
{
|
||||
ResourceDescriptor->Type = CmResourceTypeInterrupt;
|
||||
|
||||
if (PortConfig->AdapterInterfaceType == MicroChannel ||
|
||||
PortConfig->InterruptMode == LevelSensitive)
|
||||
{
|
||||
ResourceDescriptor->ShareDisposition = CmResourceShareShared;
|
||||
ResourceDescriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
ResourceDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
|
||||
ResourceDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
|
||||
}
|
||||
|
||||
ResourceDescriptor->u.Interrupt.Level = PortConfig->BusInterruptLevel;
|
||||
ResourceDescriptor->u.Interrupt.Vector = PortConfig->BusInterruptVector;
|
||||
ResourceDescriptor->u.Interrupt.Affinity = 0;
|
||||
|
||||
ResourceDescriptor++;
|
||||
}
|
||||
|
||||
/* Copy DMA data */
|
||||
if (Dma)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue