mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
Fixed debugging messages and other minor changes
svn path=/trunk/; revision=70
This commit is contained in:
parent
e1d692c393
commit
8909f04b2c
1 changed files with 24 additions and 11 deletions
|
@ -57,6 +57,11 @@
|
||||||
// FIXME: finish implementation of QueryInformation
|
// FIXME: finish implementation of QueryInformation
|
||||||
// FIXME: finish implementation of SetInformation
|
// FIXME: finish implementation of SetInformation
|
||||||
// FIXME: finish implementation of DeviceControl
|
// FIXME: finish implementation of DeviceControl
|
||||||
|
// FIXME: bring up to ATA-3 spec
|
||||||
|
// FIXME: add general support for ATAPI devices
|
||||||
|
// FIXME: add support for ATAPI CDROMs
|
||||||
|
// FIXME: add support for ATAPI ZIP drives/RHDs
|
||||||
|
// FIXME: add support for ATAPI tape drives
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
|
||||||
|
@ -107,6 +112,7 @@ IDE_CONTROLLER_PARAMETERS Controllers[IDE_MAX_CONTROLLERS] =
|
||||||
{0x0168, 8, 0x0368, 8, 10, 10, 15, LevelSensitive, 0xffff}
|
{0x0168, 8, 0x0368, 8, 10, 10, 15, LevelSensitive, 0xffff}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static BOOLEAN IDEInitialized = FALSE;
|
||||||
static int TotalPartitions = 0;
|
static int TotalPartitions = 0;
|
||||||
|
|
||||||
// ----------------------------------------------- Discardable Declarations
|
// ----------------------------------------------- Discardable Declarations
|
||||||
|
@ -250,6 +256,11 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
|
||||||
&Controllers[ControllerIdx], ControllerIdx);
|
&Controllers[ControllerIdx], ControllerIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (WeGotSomeDisks)
|
||||||
|
{
|
||||||
|
IDEInitialized = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return WeGotSomeDisks ? STATUS_SUCCESS : STATUS_NO_SUCH_DEVICE;
|
return WeGotSomeDisks ? STATUS_SUCCESS : STATUS_NO_SUCH_DEVICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -538,7 +549,7 @@ IDECreateDevices(IN PDRIVER_OBJECT DriverObject,
|
||||||
ControllerExtension->TimerState = IDETimerIdle;
|
ControllerExtension->TimerState = IDETimerIdle;
|
||||||
ControllerExtension->TimerCount = 0;
|
ControllerExtension->TimerCount = 0;
|
||||||
ControllerExtension->TimerDevice = RawDeviceObject;
|
ControllerExtension->TimerDevice = RawDeviceObject;
|
||||||
// IoInitializeTimer(RawDeviceObject, IDEIoTimer, ControllerExtension);
|
IoInitializeTimer(RawDeviceObject, IDEIoTimer, ControllerExtension);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -554,7 +565,7 @@ IDECreateDevices(IN PDRIVER_OBJECT DriverObject,
|
||||||
{
|
{
|
||||||
|
|
||||||
// build devices for all partitions in table
|
// build devices for all partitions in table
|
||||||
DPRINT("partitions on Harddisk%d:\n", HarddiskIdx);
|
DPRINT("partitions on %s:\n", DeviceDirName);
|
||||||
for (PartitionIdx = 0; PartitionIdx < 4; PartitionIdx++)
|
for (PartitionIdx = 0; PartitionIdx < 4; PartitionIdx++)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -564,8 +575,9 @@ IDECreateDevices(IN PDRIVER_OBJECT DriverObject,
|
||||||
// if the partition entry is in use, create a device for it
|
// if the partition entry is in use, create a device for it
|
||||||
if (PartitionIsSupported(p))
|
if (PartitionIsSupported(p))
|
||||||
{
|
{
|
||||||
DPRINT("Harddisk%d type:%02x Offset:%d Size:%d\n",
|
DPRINT("%s ptbl entry:%d type:%02x Offset:%d Size:%d\n",
|
||||||
HarddiskIdx,
|
DeviceDirName,
|
||||||
|
PartitionIdx,
|
||||||
p->PartitionType,
|
p->PartitionType,
|
||||||
p->StartingBlock,
|
p->StartingBlock,
|
||||||
p->SectorCount);
|
p->SectorCount);
|
||||||
|
@ -920,6 +932,7 @@ IDECreateDevice(IN PDRIVER_OBJECT DriverObject,
|
||||||
|
|
||||||
if (Win32Alias != NULL)
|
if (Win32Alias != NULL)
|
||||||
{
|
{
|
||||||
|
DPRINT("Creating SymLink %s --> %s\n", DeviceName, Win32Alias);
|
||||||
RtlInitAnsiString(&AnsiSymLink, Win32Alias);
|
RtlInitAnsiString(&AnsiSymLink, Win32Alias);
|
||||||
RtlAnsiStringToUnicodeString(&SymLink, &AnsiSymLink, TRUE);
|
RtlAnsiStringToUnicodeString(&SymLink, &AnsiSymLink, TRUE);
|
||||||
IoCreateSymbolicLink(&SymLink, &UnicodeName);
|
IoCreateSymbolicLink(&SymLink, &UnicodeName);
|
||||||
|
@ -1131,7 +1144,6 @@ IDEDispatchReadWrite(IN PDEVICE_OBJECT pDO,
|
||||||
|
|
||||||
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
DeviceExtension = (PIDE_DEVICE_EXTENSION)pDO->DeviceExtension;
|
DeviceExtension = (PIDE_DEVICE_EXTENSION)pDO->DeviceExtension;
|
||||||
DPRINT("MajorFunction %d\n", IrpStack->MajorFunction);
|
|
||||||
|
|
||||||
// Validate operation parameters
|
// Validate operation parameters
|
||||||
AdjustedOffset = RtlEnlargedIntegerMultiply(DeviceExtension->Offset,
|
AdjustedOffset = RtlEnlargedIntegerMultiply(DeviceExtension->Offset,
|
||||||
|
@ -1304,14 +1316,10 @@ IDEStartIo(IN PDEVICE_OBJECT DeviceObject,
|
||||||
DeviceExtension->BytesRequested -= DeviceExtension->BytesToTransfer;
|
DeviceExtension->BytesRequested -= DeviceExtension->BytesToTransfer;
|
||||||
DeviceExtension->SectorsTransferred = 0;
|
DeviceExtension->SectorsTransferred = 0;
|
||||||
DeviceExtension->TargetAddress = (BYTE *)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
DeviceExtension->TargetAddress = (BYTE *)MmGetSystemAddressForMdl(Irp->MdlAddress);
|
||||||
DPRINT("UserBuffer %x MdlAddress %x TargetAddress %x\n",
|
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
|
||||||
Irp->UserBuffer,
|
|
||||||
Irp->MdlAddress,
|
|
||||||
DeviceExtension->TargetAddress);
|
|
||||||
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
|
|
||||||
IoAllocateController(DeviceExtension->ControllerObject,
|
IoAllocateController(DeviceExtension->ControllerObject,
|
||||||
DeviceObject, IDEAllocateController, NULL);
|
DeviceObject, IDEAllocateController, NULL);
|
||||||
KeLowerIrql(OldIrql);
|
KeLowerIrql(OldIrql);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1524,6 +1532,11 @@ IDEIsr(IN PKINTERRUPT Interrupt,
|
||||||
PIDE_DEVICE_EXTENSION DeviceExtension;
|
PIDE_DEVICE_EXTENSION DeviceExtension;
|
||||||
PIDE_CONTROLLER_EXTENSION ControllerExtension;
|
PIDE_CONTROLLER_EXTENSION ControllerExtension;
|
||||||
|
|
||||||
|
if (IDEInitialized == FALSE)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
ControllerExtension = (PIDE_CONTROLLER_EXTENSION) ServiceContext;
|
ControllerExtension = (PIDE_CONTROLLER_EXTENSION) ServiceContext;
|
||||||
|
|
||||||
// Read the status port to clear the interrtupt (even if it's not ours).
|
// Read the status port to clear the interrtupt (even if it's not ours).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue