mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 00:41:36 +00:00
[FREELDR][SCSIPORT][STORPORT] Use existing defines for some hardcoded max values.
See https://www.osronline.com/article.cfm%5Earticle=538.htm
[SCSIPORT] Remove 'MaxBus' variable, deprecated since commit fc3d38d1c
(r26220).
This commit is contained in:
parent
0fbd5eda85
commit
3bc71f9086
|
@ -455,8 +455,10 @@ SpiCreatePortConfig(
|
||||||
ConfigInfo->AtdiskSecondaryClaimed = FALSE; // FIXME
|
ConfigInfo->AtdiskSecondaryClaimed = FALSE; // FIXME
|
||||||
|
|
||||||
/* Initiator bus id is not set */
|
/* Initiator bus id is not set */
|
||||||
for (Bus = 0; Bus < 8; Bus++)
|
for (Bus = 0; Bus < RTL_NUMBER_OF(ConfigInfo->InitiatorBusId); Bus++)
|
||||||
|
{
|
||||||
ConfigInfo->InitiatorBusId[Bus] = (CCHAR)SP_UNINITIALIZED_VALUE;
|
ConfigInfo->InitiatorBusId[Bus] = (CCHAR)SP_UNINITIALIZED_VALUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigInfo->NumberOfPhysicalBreaks = 17;
|
ConfigInfo->NumberOfPhysicalBreaks = 17;
|
||||||
|
@ -644,7 +646,7 @@ ScsiPortGetPhysicalAddress(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Nothing */
|
/* Nothing */
|
||||||
PhysicalAddress.QuadPart = (LONGLONG)(SP_UNINITIALIZED_VALUE);
|
PhysicalAddress.QuadPart = (LONGLONG)SP_UNINITIALIZED_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
*Length = BufferLength;
|
*Length = BufferLength;
|
||||||
|
|
|
@ -569,7 +569,7 @@ ScsiPortGetPhysicalAddress(IN PVOID HwDeviceExtension,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Nothing */
|
/* Nothing */
|
||||||
PhysicalAddress.QuadPart = (LONGLONG)(SP_UNINITIALIZED_VALUE);
|
PhysicalAddress.QuadPart = (LONGLONG)SP_UNINITIALIZED_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
*Length = (ULONG)BufferLength;
|
*Length = (ULONG)BufferLength;
|
||||||
|
@ -852,7 +852,6 @@ ScsiPortInitialize(
|
||||||
BOOLEAN FirstConfigCall = TRUE;
|
BOOLEAN FirstConfigCall = TRUE;
|
||||||
ULONG Result;
|
ULONG Result;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG MaxBus;
|
|
||||||
PCI_SLOT_NUMBER SlotNumber;
|
PCI_SLOT_NUMBER SlotNumber;
|
||||||
|
|
||||||
PDEVICE_OBJECT PortDeviceObject;
|
PDEVICE_OBJECT PortDeviceObject;
|
||||||
|
@ -861,7 +860,7 @@ ScsiPortInitialize(
|
||||||
|
|
||||||
PCM_RESOURCE_LIST ResourceList;
|
PCM_RESOURCE_LIST ResourceList;
|
||||||
|
|
||||||
DPRINT ("ScsiPortInitialize() called!\n");
|
DPRINT("ScsiPortInitialize() called!\n");
|
||||||
|
|
||||||
/* Check params for validity */
|
/* Check params for validity */
|
||||||
if ((HwInitializationData->HwInitialize == NULL) ||
|
if ((HwInitializationData->HwInitialize == NULL) ||
|
||||||
|
@ -945,8 +944,8 @@ ScsiPortInitialize(
|
||||||
DeviceExtensionSize = sizeof(SCSI_PORT_DEVICE_EXTENSION) +
|
DeviceExtensionSize = sizeof(SCSI_PORT_DEVICE_EXTENSION) +
|
||||||
HwInitializationData->DeviceExtensionSize;
|
HwInitializationData->DeviceExtensionSize;
|
||||||
|
|
||||||
MaxBus = (HwInitializationData->AdapterInterfaceType == PCIBus) ? 8 : 1;
|
DPRINT("AdapterInterfaceType: %lu\n",
|
||||||
DPRINT("MaxBus: %lu\n", MaxBus);
|
HwInitializationData->AdapterInterfaceType);
|
||||||
|
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
|
@ -1080,7 +1079,8 @@ CreatePortConfig:
|
||||||
if ((HwInitializationData->AdapterInterfaceType == PCIBus) &&
|
if ((HwInitializationData->AdapterInterfaceType == PCIBus) &&
|
||||||
(HwInitializationData->VendorIdLength > 0) &&
|
(HwInitializationData->VendorIdLength > 0) &&
|
||||||
(HwInitializationData->VendorId != NULL) &&
|
(HwInitializationData->VendorId != NULL) &&
|
||||||
(HwInitializationData->DeviceIdLength > 0) && (HwInitializationData->DeviceId != NULL))
|
(HwInitializationData->DeviceIdLength > 0) &&
|
||||||
|
(HwInitializationData->DeviceId != NULL))
|
||||||
{
|
{
|
||||||
PortConfig->BusInterruptLevel = 0;
|
PortConfig->BusInterruptLevel = 0;
|
||||||
|
|
||||||
|
@ -1360,7 +1360,7 @@ CreatePortConfig:
|
||||||
if (!Again)
|
if (!Again)
|
||||||
ConfigInfo.BusNumber++;
|
ConfigInfo.BusNumber++;
|
||||||
|
|
||||||
DPRINT("Bus: %lu MaxBus: %lu\n", ConfigInfo.BusNumber, MaxBus);
|
DPRINT(" Bus: %lu\n", ConfigInfo.BusNumber);
|
||||||
|
|
||||||
DeviceFound = TRUE;
|
DeviceFound = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -2402,7 +2402,7 @@ SpiCreatePortConfig(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
ConfigInfo->DmaPort2 = SP_UNINITIALIZED_VALUE;
|
ConfigInfo->DmaPort2 = SP_UNINITIALIZED_VALUE;
|
||||||
ConfigInfo->MaximumTransferLength = SP_UNINITIALIZED_VALUE;
|
ConfigInfo->MaximumTransferLength = SP_UNINITIALIZED_VALUE;
|
||||||
ConfigInfo->NumberOfAccessRanges = HwInitData->NumberOfAccessRanges;
|
ConfigInfo->NumberOfAccessRanges = HwInitData->NumberOfAccessRanges;
|
||||||
ConfigInfo->MaximumNumberOfTargets = 8;
|
ConfigInfo->MaximumNumberOfTargets = SCSI_MAXIMUM_TARGETS; // NOTE: Using legacy value.
|
||||||
|
|
||||||
/* Store parameters */
|
/* Store parameters */
|
||||||
ConfigInfo->NeedPhysicalAddresses = HwInitData->NeedPhysicalAddresses;
|
ConfigInfo->NeedPhysicalAddresses = HwInitData->NeedPhysicalAddresses;
|
||||||
|
@ -2418,8 +2418,10 @@ SpiCreatePortConfig(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
ConfigInfo->AtdiskSecondaryClaimed = DdkConfigInformation->AtDiskSecondaryAddressClaimed;
|
ConfigInfo->AtdiskSecondaryClaimed = DdkConfigInformation->AtDiskSecondaryAddressClaimed;
|
||||||
|
|
||||||
/* Initiator bus id is not set */
|
/* Initiator bus id is not set */
|
||||||
for (Bus = 0; Bus < 8; Bus++)
|
for (Bus = 0; Bus < RTL_NUMBER_OF(ConfigInfo->InitiatorBusId); Bus++)
|
||||||
|
{
|
||||||
ConfigInfo->InitiatorBusId[Bus] = (CCHAR)SP_UNINITIALIZED_VALUE;
|
ConfigInfo->InitiatorBusId[Bus] = (CCHAR)SP_UNINITIALIZED_VALUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigInfo->NumberOfPhysicalBreaks = 17;
|
ConfigInfo->NumberOfPhysicalBreaks = 17;
|
||||||
|
@ -2690,7 +2692,7 @@ SpiParseDeviceInfo(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
|
|
||||||
/* Check / reset if needed */
|
/* Check / reset if needed */
|
||||||
if (ConfigInfo->InitiatorBusId[0] > ConfigInfo->MaximumNumberOfTargets - 1)
|
if (ConfigInfo->InitiatorBusId[0] > ConfigInfo->MaximumNumberOfTargets - 1)
|
||||||
ConfigInfo->InitiatorBusId[0] = (CCHAR)-1;
|
ConfigInfo->InitiatorBusId[0] = (CCHAR)SP_UNINITIALIZED_VALUE;
|
||||||
|
|
||||||
DPRINT("InitiatorTargetId = %d\n", ConfigInfo->InitiatorBusId[0]);
|
DPRINT("InitiatorTargetId = %d\n", ConfigInfo->InitiatorBusId[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,9 +41,9 @@ InitializeConfiguration(
|
||||||
PortConfig->SlotNumber = SlotNumber;
|
PortConfig->SlotNumber = SlotNumber;
|
||||||
PortConfig->AdapterInterfaceType = InitData->AdapterInterfaceType;
|
PortConfig->AdapterInterfaceType = InitData->AdapterInterfaceType;
|
||||||
|
|
||||||
PortConfig->MaximumTransferLength = -1; //SP_UNINITIALIZED_VALUE;
|
PortConfig->MaximumTransferLength = SP_UNINITIALIZED_VALUE;
|
||||||
PortConfig->DmaChannel = -1; //SP_UNINITIALIZED_VALUE;
|
PortConfig->DmaChannel = SP_UNINITIALIZED_VALUE;
|
||||||
PortConfig->DmaPort = -1; //SP_UNINITIALIZED_VALUE;
|
PortConfig->DmaPort = SP_UNINITIALIZED_VALUE;
|
||||||
|
|
||||||
PortConfig->InterruptMode = LevelSensitive;
|
PortConfig->InterruptMode = LevelSensitive;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ InitializeConfiguration(
|
||||||
PortConfig->ReceiveEvent = InitData->ReceiveEvent;
|
PortConfig->ReceiveEvent = InitData->ReceiveEvent;
|
||||||
PortConfig->RealModeInitialized = FALSE;
|
PortConfig->RealModeInitialized = FALSE;
|
||||||
PortConfig->BufferAccessScsiPortControlled = TRUE;
|
PortConfig->BufferAccessScsiPortControlled = TRUE;
|
||||||
PortConfig->MaximumNumberOfTargets = 128;
|
PortConfig->MaximumNumberOfTargets = SCSI_MAXIMUM_TARGETS_PER_BUS;
|
||||||
|
|
||||||
PortConfig->SpecificLuExtensionSize = InitData->SpecificLuExtensionSize;
|
PortConfig->SpecificLuExtensionSize = InitData->SpecificLuExtensionSize;
|
||||||
PortConfig->SrbExtensionSize = InitData->SrbExtensionSize;
|
PortConfig->SrbExtensionSize = InitData->SrbExtensionSize;
|
||||||
|
@ -82,8 +82,10 @@ InitializeConfiguration(
|
||||||
PortConfig->NumberOfAccessRanges * sizeof(ACCESS_RANGE));
|
PortConfig->NumberOfAccessRanges * sizeof(ACCESS_RANGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 7; i++)
|
for (i = 0; i < RTL_NUMBER_OF(PortConfig->InitiatorBusId); i++)
|
||||||
PortConfig->InitiatorBusId[i] = 0xff;
|
{
|
||||||
|
PortConfig->InitiatorBusId[i] = (CCHAR)SP_UNINITIALIZED_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue