[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:
Cameron Gutman 2010-10-15 19:25:07 +00:00
parent b5fef1ffcd
commit 50bca246a8

View file

@ -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)
{