mirror of
https://github.com/reactos/reactos.git
synced 2024-07-21 11:48:04 +00:00
- Delete unneeded fields from DeviceExtension.
- Reformat ScsiPortGetVirtualAddress(), and make it using SrbExtensionBuffer pointer instead of a removed VirtualAddress. svn path=/trunk/; revision=27471
This commit is contained in:
parent
ad9fd2687e
commit
540155a12a
|
@ -522,7 +522,7 @@ ScsiPortGetPhysicalAddress(IN PVOID HwDeviceExtension,
|
|||
/* Simply look it up in the allocated common buffer */
|
||||
Offset = (PUCHAR)VirtualAddress - (PUCHAR)DeviceExtension->SrbExtensionBuffer;
|
||||
|
||||
BufferLength = DeviceExtension->CommonBufferSize - Offset;
|
||||
BufferLength = DeviceExtension->CommonBufferLength - Offset;
|
||||
PhysicalAddress.QuadPart = DeviceExtension->PhysicalAddress.QuadPart + Offset;
|
||||
}
|
||||
else if (DeviceExtension->MapRegisters)
|
||||
|
@ -763,26 +763,27 @@ SpiAllocateCommonBuffer(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, ULONG NonCa
|
|||
*/
|
||||
PVOID STDCALL
|
||||
ScsiPortGetVirtualAddress(IN PVOID HwDeviceExtension,
|
||||
IN SCSI_PHYSICAL_ADDRESS PhysicalAddress)
|
||||
IN SCSI_PHYSICAL_ADDRESS PhysicalAddress)
|
||||
{
|
||||
PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||
ULONG Offset;
|
||||
PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||
ULONG Offset;
|
||||
|
||||
DPRINT("ScsiPortGetVirtualAddress(%p %I64x)\n",
|
||||
HwDeviceExtension, PhysicalAddress.QuadPart);
|
||||
DPRINT("ScsiPortGetVirtualAddress(%p %I64x)\n",
|
||||
HwDeviceExtension, PhysicalAddress.QuadPart);
|
||||
|
||||
DeviceExtension = CONTAINING_RECORD(HwDeviceExtension,
|
||||
SCSI_PORT_DEVICE_EXTENSION,
|
||||
MiniPortDeviceExtension);
|
||||
DeviceExtension = CONTAINING_RECORD(HwDeviceExtension,
|
||||
SCSI_PORT_DEVICE_EXTENSION,
|
||||
MiniPortDeviceExtension);
|
||||
|
||||
if (DeviceExtension->PhysicalAddress.QuadPart > PhysicalAddress.QuadPart)
|
||||
return NULL;
|
||||
if (DeviceExtension->PhysicalAddress.QuadPart > PhysicalAddress.QuadPart)
|
||||
return NULL;
|
||||
|
||||
Offset = (ULONG)(PhysicalAddress.QuadPart - DeviceExtension->PhysicalAddress.QuadPart);
|
||||
if (Offset >= DeviceExtension->CommonBufferLength)
|
||||
return NULL;
|
||||
Offset = (ULONG)(PhysicalAddress.QuadPart - DeviceExtension->PhysicalAddress.QuadPart);
|
||||
|
||||
return (PVOID)((ULONG_PTR)DeviceExtension->VirtualAddress + Offset);
|
||||
if (Offset >= DeviceExtension->CommonBufferLength)
|
||||
return NULL;
|
||||
|
||||
return (PVOID)((ULONG_PTR)DeviceExtension->SrbExtensionBuffer + Offset);
|
||||
}
|
||||
|
||||
static VOID
|
||||
|
@ -1633,7 +1634,7 @@ SpiCleanupAfterInit(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
|
|||
|
||||
/* Free common buffer (if it exists) */
|
||||
if (DeviceExtension->SrbExtensionBuffer != NULL &&
|
||||
DeviceExtension->CommonBufferSize != 0)
|
||||
DeviceExtension->CommonBufferLength != 0)
|
||||
{
|
||||
if (!DeviceExtension->AdapterObject)
|
||||
{
|
||||
|
@ -1643,7 +1644,7 @@ SpiCleanupAfterInit(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
|
|||
{
|
||||
#if 0
|
||||
HalFreeCommonBuffer(DeviceExtension->AdapterObject,
|
||||
DeviceExtension->CommonBufferSize,
|
||||
DeviceExtension->CommonBufferLength,
|
||||
DeviceExtension->PhysicalCommonBuffer,
|
||||
DeviceExtension->SrbExtensionBuffer,
|
||||
FALSE);
|
||||
|
|
|
@ -238,7 +238,6 @@ typedef struct _SCSI_PORT_DEVICE_EXTENSION
|
|||
|
||||
SCSI_PORT_INTERRUPT_DATA InterruptData;
|
||||
|
||||
ULONG CommonBufferSize;
|
||||
/* SRB extension stuff*/
|
||||
ULONG SrbExtensionSize;
|
||||
PVOID SrbExtensionBuffer;
|
||||
|
@ -279,7 +278,6 @@ typedef struct _SCSI_PORT_DEVICE_EXTENSION
|
|||
BOOLEAN ReceiveEvent;
|
||||
|
||||
PHYSICAL_ADDRESS PhysicalAddress;
|
||||
PVOID VirtualAddress;
|
||||
ULONG CommonBufferLength;
|
||||
ULONG InterruptLevel;
|
||||
ULONG IoAddress;
|
||||
|
|
Loading…
Reference in a new issue