Author: fireball
Date: Sun Jul 8 16:32:02 2007
New Revision: 27471
URL:
http://svn.reactos.org/svn/reactos?rev=27471&view=rev
Log:
- Delete unneeded fields from DeviceExtension.
- Reformat ScsiPortGetVirtualAddress(), and make it using SrbExtensionBuffer pointer
instead of a removed VirtualAddress.
Modified:
trunk/reactos/drivers/storage/scsiport/scsiport.c
trunk/reactos/drivers/storage/scsiport/scsiport_int.h
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
==============================================================================
--- trunk/reactos/drivers/storage/scsiport/scsiport.c (original)
+++ trunk/reactos/drivers/storage/scsiport/scsiport.c Sun Jul 8 16:32:02 2007
@@ -522,7 +522,7 @@
/* 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 @@
*/
PVOID STDCALL
ScsiPortGetVirtualAddress(IN PVOID HwDeviceExtension,
- IN SCSI_PHYSICAL_ADDRESS PhysicalAddress)
+ IN SCSI_PHYSICAL_ADDRESS PhysicalAddress)
{
- PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
- ULONG Offset;
-
- DPRINT("ScsiPortGetVirtualAddress(%p %I64x)\n",
- HwDeviceExtension, PhysicalAddress.QuadPart);
-
- DeviceExtension = CONTAINING_RECORD(HwDeviceExtension,
- SCSI_PORT_DEVICE_EXTENSION,
- MiniPortDeviceExtension);
-
- if (DeviceExtension->PhysicalAddress.QuadPart > PhysicalAddress.QuadPart)
- return NULL;
-
- Offset = (ULONG)(PhysicalAddress.QuadPart -
DeviceExtension->PhysicalAddress.QuadPart);
- if (Offset >= DeviceExtension->CommonBufferLength)
- return NULL;
-
- return (PVOID)((ULONG_PTR)DeviceExtension->VirtualAddress + Offset);
+ PSCSI_PORT_DEVICE_EXTENSION DeviceExtension;
+ ULONG Offset;
+
+ DPRINT("ScsiPortGetVirtualAddress(%p %I64x)\n",
+ HwDeviceExtension, PhysicalAddress.QuadPart);
+
+ DeviceExtension = CONTAINING_RECORD(HwDeviceExtension,
+ SCSI_PORT_DEVICE_EXTENSION,
+ MiniPortDeviceExtension);
+
+ if (DeviceExtension->PhysicalAddress.QuadPart > PhysicalAddress.QuadPart)
+ return NULL;
+
+ Offset = (ULONG)(PhysicalAddress.QuadPart -
DeviceExtension->PhysicalAddress.QuadPart);
+
+ if (Offset >= DeviceExtension->CommonBufferLength)
+ return NULL;
+
+ return (PVOID)((ULONG_PTR)DeviceExtension->SrbExtensionBuffer + Offset);
}
static VOID
@@ -1633,7 +1634,7 @@
/* Free common buffer (if it exists) */
if (DeviceExtension->SrbExtensionBuffer != NULL &&
- DeviceExtension->CommonBufferSize != 0)
+ DeviceExtension->CommonBufferLength != 0)
{
if (!DeviceExtension->AdapterObject)
{
@@ -1643,7 +1644,7 @@
{
#if 0
HalFreeCommonBuffer(DeviceExtension->AdapterObject,
- DeviceExtension->CommonBufferSize,
+ DeviceExtension->CommonBufferLength,
DeviceExtension->PhysicalCommonBuffer,
DeviceExtension->SrbExtensionBuffer,
FALSE);
Modified: trunk/reactos/drivers/storage/scsiport/scsiport_int.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
==============================================================================
--- trunk/reactos/drivers/storage/scsiport/scsiport_int.h (original)
+++ trunk/reactos/drivers/storage/scsiport/scsiport_int.h Sun Jul 8 16:32:02 2007
@@ -238,7 +238,6 @@
SCSI_PORT_INTERRUPT_DATA InterruptData;
- ULONG CommonBufferSize;
/* SRB extension stuff*/
ULONG SrbExtensionSize;
PVOID SrbExtensionBuffer;
@@ -279,7 +278,6 @@
BOOLEAN ReceiveEvent;
PHYSICAL_ADDRESS PhysicalAddress;
- PVOID VirtualAddress;
ULONG CommonBufferLength;
ULONG InterruptLevel;
ULONG IoAddress;