Author: jgardou
Date: Sun Oct 31 10:42:40 2010
New Revision: 49373
URL:
http://svn.reactos.org/svn/reactos?rev=49373&view=rev
Log:
revert 49345 as requested by ros arm team.
Modified:
branches/cmake-bringup/drivers/storage/classpnp/autorun.c
branches/cmake-bringup/drivers/storage/classpnp/class.c
branches/cmake-bringup/drivers/storage/classpnp/classp.h
branches/cmake-bringup/drivers/storage/classpnp/classwmi.c
branches/cmake-bringup/drivers/storage/classpnp/lock.c
branches/cmake-bringup/drivers/storage/classpnp/obsolete.c
branches/cmake-bringup/drivers/storage/classpnp/power.c
branches/cmake-bringup/drivers/storage/classpnp/utils.c
Modified: branches/cmake-bringup/drivers/storage/classpnp/autorun.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/c…
==============================================================================
--- branches/cmake-bringup/drivers/storage/classpnp/autorun.c [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/storage/classpnp/autorun.c [iso-8859-1] Sun Oct 31
10:42:40 2010
@@ -148,14 +148,14 @@
// ejection request occured, we could see if any locks for the media
// existed. if locked, broadcast. if not, we send the eject irp.
//
-
+
//
// for now, just always broadcast. make this a public routine,
// so class drivers can add special hacks to broadcast this for their
// non-MMC-compliant devices also from sense codes.
//
- DBGTRACE(ClassDebugTrace, ("ClassSendEjectionNotification: media
EJECT_REQUEST"));
+ DBGTRACE(ClassDebugTrace, ("ClassSendEjectionNotification: media
EJECT_REQUEST"));
ClasspSendNotification(FdoExtension,
&GUID_IO_MEDIA_EJECT_REQUEST,
0,
@@ -174,7 +174,7 @@
{
PTARGET_DEVICE_CUSTOM_NOTIFICATION notification;
ULONG requiredSize;
-
+
requiredSize =
(sizeof(TARGET_DEVICE_CUSTOM_NOTIFICATION) - sizeof(UCHAR)) +
ExtraDataSize;
@@ -186,11 +186,11 @@
requiredSize));
return;
}
-
+
notification = ExAllocatePoolWithTag(NonPagedPool,
requiredSize,
'oNcS');
-
+
//
// if none allocated, exit
//
@@ -202,7 +202,7 @@
//
// Prepare and send the request!
//
-
+
RtlZeroMemory(notification, requiredSize);
notification->Version = 1;
notification->Size = (USHORT)(requiredSize);
@@ -214,7 +214,7 @@
IoReportTargetDeviceChangeAsynchronous(FdoExtension->LowerPdo,
notification,
NULL, NULL);
-
+
ExFreePool(notification);
notification = NULL;
return;
@@ -236,7 +236,7 @@
Arguments:
FdoExtension - the device
-
+
DataBuffer - the resulting data from a GESN event.
requires at least EIGHT valid bytes (header == 4, data == 4)
@@ -245,14 +245,14 @@
event was of the DEVICE BUSY class, else true.
Return Value:
-
+
None
-
+
Notes:
DataBuffer must be at least four bytes of valid data (header == 4 bytes),
and have at least eight bytes of allocated memory (all events == 4 bytes).
-
+
The call to StartNextPacket may occur before this routine is completed.
the operational change notifications are informational in nature, and
while useful, are not neccessary to ensure proper operation. For example,
@@ -261,12 +261,12 @@
IOCTL_IS_DISK_WRITABLE may be called and get an incorrect response. If
a device supports software write protect, it is expected that the
application can handle such a case.
-
+
NOTE: perhaps setting the updaterequired byte to one should be done here.
if so, it relies upon the setting of a 32-byte value to be an atomic
operation. unfortunately, there is no simple way to notify a class driver
which wants to know that the device behavior requires updating.
-
+
Not ready events may be sent every second. For example, if we were
to minimize the number of asynchronous notifications, an application may
register just after a large busy time was reported. This would then
@@ -339,7 +339,7 @@
lowestSetBit ^= (info->Gesn.EventMask);
if (thisEventBit != lowestSetBit) {
-
+
//
// HACKHACK - REF #0001
// the first time we ever see an event set that is not the lowest
@@ -352,11 +352,11 @@
"Classpnp => GESN::NONE: Compliant drive found, "
"removing GESN hack (%x, %x)\n",
thisEventBit, info->Gesn.EventMask));
-
+
info->Gesn.HackEventMask = FALSE;
} else if (thisEvent == 0) {
-
+
//
// HACKHACK - REF #0001
// note: this hack prevents poorly implemented firmware from constantly
@@ -409,13 +409,13 @@
&GUID_IO_GENERIC_GESN_EVENT,
sizeof(NOTIFICATION_EVENT_STATUS_HEADER) + dataLength,
Header)
-*/
+*/
switch (Header->NotificationClass) {
case NOTIFICATION_EXTERNAL_REQUEST_CLASS_EVENTS: { // 0x3
-
- PNOTIFICATION_EXTERNAL_STATUS externalInfo =
+
+ PNOTIFICATION_EXTERNAL_STATUS externalInfo =
(PNOTIFICATION_EXTERNAL_STATUS)(Header->ClassEventData);
DEVICE_EVENT_EXTERNAL_REQUEST externalData;
@@ -424,12 +424,12 @@
// about keys being pressed, and not released. this makes keys
// single-function, but simplifies the code significantly.
//
-
+
if (externalInfo->ExternalEvent !=
NOTIFICATION_EXTERNAL_EVENT_BUTTON_DOWN) {
break;
}
-
+
*ResendImmediately = TRUE;
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugMCN,
"Classpnp => GESN::EXTERNAL: Event: %x Status %x Req
%x\n",
@@ -447,28 +447,28 @@
KeQuerySystemTime(&(externalData.SystemTime));
externalData.SystemTime.QuadPart *= (LONGLONG)KeQueryTimeIncrement();
- DBGTRACE(ClassDebugTrace, ("ClasspInterpretGesnData: media
DEVICE_EXTERNAL_REQUEST"));
+ DBGTRACE(ClassDebugTrace, ("ClasspInterpretGesnData: media
DEVICE_EXTERNAL_REQUEST"));
ClasspSendNotification(FdoExtension,
&GUID_IO_DEVICE_EXTERNAL_REQUEST,
sizeof(DEVICE_EVENT_EXTERNAL_REQUEST),
&externalData);
return;
}
-
+
case NOTIFICATION_MEDIA_STATUS_CLASS_EVENTS: { // 0x4
-
+
PNOTIFICATION_MEDIA_STATUS mediaInfo =
(PNOTIFICATION_MEDIA_STATUS)(Header->ClassEventData);
-
+
if (mediaInfo->MediaEvent == NOTIFICATION_MEDIA_EVENT_NO_CHANGE) {
break;
}
-
+
*ResendImmediately = TRUE;
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugMCN,
"Classpnp => GESN::MEDIA: Event: %x Status %x\n",
mediaInfo->MediaEvent, mediaInfo->MediaStatus));
-
+
if ((mediaInfo->MediaEvent == NOTIFICATION_MEDIA_EVENT_NEW_MEDIA) ||
(mediaInfo->MediaEvent == NOTIFICATION_MEDIA_EVENT_MEDIA_CHANGE)) {
@@ -489,29 +489,29 @@
TRUE);
} else if (mediaInfo->MediaEvent == NOTIFICATION_MEDIA_EVENT_MEDIA_REMOVAL) {
-
+
ClasspSetMediaChangeStateEx(FdoExtension,
MediaNotPresent,
FALSE,
TRUE);
-
+
} else if (mediaInfo->MediaEvent == NOTIFICATION_MEDIA_EVENT_EJECT_REQUEST) {
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugError,
"Classpnp => GESN Ejection request received!\n"));
ClassSendEjectionNotification(FdoExtension);
-
+
}
break;
}
-
+
case NOTIFICATION_DEVICE_BUSY_CLASS_EVENTS: { // lowest priority events...
-
+
PNOTIFICATION_BUSY_STATUS busyInfo =
(PNOTIFICATION_BUSY_STATUS)(Header->ClassEventData);
DEVICE_EVENT_BECOMING_READY busyData;
-
+
//
// NOTE: we never actually need to immediately retry for these
// events: if one exists, the device is busy, and if not,
@@ -521,7 +521,7 @@
if (busyInfo->DeviceBusyStatus == NOTIFICATION_BUSY_STATUS_NO_EVENT) {
break;
}
-
+
//
// else we want to report the approximated time till it's ready.
//
@@ -531,28 +531,28 @@
busyData.Reason = busyInfo->DeviceBusyStatus;
busyData.Estimated100msToReady = (busyInfo->Time[0] << 8) |
(busyInfo->Time[1] & 0xff);
-
+
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugMCN,
"Classpnp => GESN::BUSY: Event: %x Status %x Time %x\n",
busyInfo->DeviceBusyEvent, busyInfo->DeviceBusyStatus,
busyData.Estimated100msToReady
));
- DBGTRACE(ClassDebugTrace, ("ClasspInterpretGesnData: media
BECOMING_READY"));
+ DBGTRACE(ClassDebugTrace, ("ClasspInterpretGesnData: media
BECOMING_READY"));
ClasspSendNotification(FdoExtension,
&GUID_IO_DEVICE_BECOMING_READY,
sizeof(DEVICE_EVENT_BECOMING_READY),
&busyData);
break;
}
-
+
default: {
-
+
break;
}
-
- } // end switch on notification class
+
+ } // end switch on notification class
return;
}
@@ -577,7 +577,7 @@
MediaPresent - indicates whether the device has media inserted into it
(TRUE) or not (FALSE).
-
+
Return Value:
none
@@ -656,7 +656,7 @@
sizeof(ULONG),
&data);
- }
+ }
else if (NewState == MediaNotPresent) {
DBGTRACE(ClassDebugTrace, ("ClasspInternalSetMediaChangeState: media
REMOVAL"));
@@ -673,7 +673,7 @@
return;
}
-
+
return;
} // end ClasspInternalSetMediaChangeState()
@@ -769,10 +769,7 @@
return;
} // end ClassSetMediaChangeStateEx()
-
-SCSIPORTAPI
VOID
-NTAPI
ClassSetMediaChangeState(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN MEDIA_CHANGE_DETECTION_STATE NewState,
@@ -836,11 +833,11 @@
/*
* HACK for IoMega 2GB Jaz drive:
- * This drive spins down on its own to preserve the media.
+ * This drive spins down on its own to preserve the media.
* When spun down, TUR fails with 2/4/0
(SCSI_SENSE_NOT_READY/SCSI_ADSENSE_LUN_NOT_READY/?).
* ClassInterpretSenseInfo would then call ClassSendStartUnit to spin the media up,
which defeats the
* purpose of the spindown.
- * So in this case, make this into a successful TUR.
+ * So in this case, make this into a successful TUR.
* This allows the drive to stay spun down until it is actually accessed again.
* (If the media were actually removed, TUR would fail with 2/3a/0 ).
* This hack only applies to drives with the CAUSE_NOT_REPORTABLE_HACK bit set;
this
@@ -849,15 +846,15 @@
if ((SRB_STATUS(Srb->SrbStatus) != SRB_STATUS_SUCCESS) &&
TEST_FLAG(fdoExtension->ScanForSpecialFlags,
CLASS_SPECIAL_CAUSE_NOT_REPORTABLE_HACK) &&
(Srb->SenseInfoBufferLength >= RTL_SIZEOF_THROUGH_FIELD(SENSE_DATA,
AdditionalSenseCode))){
-
+
PSENSE_DATA senseData = Srb->SenseInfoBuffer;
-
- if ((senseData->SenseKey == SCSI_SENSE_NOT_READY) &&
+
+ if ((senseData->SenseKey == SCSI_SENSE_NOT_READY) &&
(senseData->AdditionalSenseCode == SCSI_ADSENSE_LUN_NOT_READY)){
Srb->SrbStatus = SRB_STATUS_SUCCESS;
}
- }
-
+ }
+
//
// use ClassInterpretSenseInfo() to check for media state, and also
@@ -876,15 +873,15 @@
&status,
NULL);
- }
+ }
else {
-
+
fdoData->LoggedTURFailureSinceLastIO = FALSE;
-
+
if (!info->Gesn.Supported) {
DBGTRACE(ClassDebugMCN, ("ClasspMediaChangeDetectionCompletion -
succeeded and GESN NOT supported, setting MediaPresent."));
-
+
//
// success != media for GESN case
//
@@ -896,7 +893,7 @@
DBGTRACE(ClassDebugMCN, ("ClasspMediaChangeDetectionCompletion -
succeeded (GESN supported)."));
}
}
-
+
if (info->Gesn.Supported) {
if (status == STATUS_DATA_OVERRUN) {
@@ -904,7 +901,7 @@
status = STATUS_SUCCESS;
}
- if (!NT_SUCCESS(status)) {
+ if (!NT_SUCCESS(status)) {
DBGTRACE(ClassDebugMCN, ("ClasspMediaChangeDetectionCompletion: GESN
failed with status %x", status));
} else {
@@ -912,7 +909,7 @@
// for GESN, need to interpret the results of the data.
// this may also require an immediate retry
//
-
+
if (Irp->IoStatus.Information == 8 ) {
ClasspInterpretGesnData(fdoExtension,
(PVOID)info->Gesn.Buffer,
@@ -949,7 +946,7 @@
//
if (retryImmediately) {
-
+
info->MediaChangeRetryCount++;
if (info->MediaChangeRetryCount > MAXIMUM_IMMEDIATE_MCN_RETRIES) {
ASSERT(!"Recursing too often in MCN?");
@@ -958,7 +955,7 @@
}
} else {
-
+
info->MediaChangeRetryCount = 0;
}
@@ -973,7 +970,7 @@
ClassAcquireRemoveLock(DeviceObject, (PIRP)(&uniqueValue));
ClassReleaseRemoveLock(DeviceObject, Irp);
-
+
//
// set the irp as not in use
//
@@ -995,18 +992,18 @@
else {
DBGTRACE(ClassDebugMCN, ("ClasspMediaChangeDetectionCompletion - not
retrying immediately"));
}
-
+
//
// release the temporary remove lock
//
-
+
ClassReleaseRemoveLock(DeviceObject, (PIRP)(&uniqueValue));
}
DBGTRACE(ClassDebugMCN, ("< ClasspMediaChangeDetectionCompletion"));
return STATUS_MORE_PROCESSING_REQUIRED;
-}
+}
/*++////////////////////////////////////////////////////////////////////////////
@@ -1018,8 +1015,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -1060,7 +1057,7 @@
if (status == REMOVE_COMPLETE) {
ASSERT(status != REMOVE_COMPLETE);
return NULL;
- }
+ }
else if (status == REMOVE_PENDING) {
ClassReleaseRemoveLock(FdoExtension->DeviceObject, irp);
return NULL;
@@ -1108,12 +1105,12 @@
srb->ScsiStatus = 0;
srb->OriginalRequest = irp;
srb->SenseInfoBufferLength = SENSE_BUFFER_SIZE;
-
+
srb->SrbFlags = FdoExtension->SrbFlags;
SET_FLAG(srb->SrbFlags, Info->SrbFlags);
srb->TimeOutValue = FdoExtension->TimeOutValue * 2;
-
+
if (srb->TimeOutValue == 0) {
if (FdoExtension->TimeOutValue == 0) {
@@ -1122,9 +1119,9 @@
"ClassSendTestUnitIrp: FdoExtension->TimeOutValue "
"is set to zero?! -- resetting to 10\n"));
srb->TimeOutValue = 10 * 2; // reasonable default
-
+
} else {
-
+
KdPrintEx((DPFLTR_CLASSPNP_ID, DPFLTR_ERROR_LEVEL,
"ClassSendTestUnitIrp: Someone set "
"srb->TimeOutValue to zero?! -- resetting to %x\n",
@@ -1134,9 +1131,9 @@
}
}
-
+
if (!UseGesn) {
-
+
srb->CdbLength = 6;
srb->DataTransferLength = 0;
SET_FLAG(srb->SrbFlags, SRB_FLAGS_NO_DATA_TRANSFER);
@@ -1145,16 +1142,16 @@
srb->DataBuffer = NULL;
srb->DataTransferLength = 0;
irp->MdlAddress = NULL;
-
+
cdb = (PCDB) &srb->Cdb[0];
cdb->CDB6GENERIC.OperationCode = SCSIOP_TEST_UNIT_READY;
} else {
-
+
ASSERT(Info->Gesn.Buffer);
srb->TimeOutValue = GESN_TIMEOUT_VALUE; // much shorter timeout for GESN
-
+
srb->CdbLength = 10;
SET_FLAG(srb->SrbFlags, SRB_FLAGS_DATA_IN);
nextIrpStack->Parameters.DeviceIoControl.IoControlCode =
@@ -1197,8 +1194,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -1349,7 +1346,7 @@
// device object directly or to the device's StartIo
// routine (which doesn't acquire the lock).
//
-
+
requestPending = TRUE;
DBGTRACE(ClassDebugMCN, (" ClasspSendMediaStateIrp - calling
IoCallDriver."));
@@ -1368,7 +1365,7 @@
}
DBGTRACE(ClassDebugMCN, ("< ClasspSendMediaStateIrp"));
-
+
return;
} // end ClasspSendMediaStateIrp()
@@ -1391,9 +1388,7 @@
none
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassCheckMediaState(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
@@ -1434,7 +1429,7 @@
Routine Description:
Resets the media change count down timer to the default number of seconds.
-
+
Arguments:
FdoExtension - the device to reset the timer for
@@ -1444,9 +1439,7 @@
None
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassResetMediaChangeTimer(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
@@ -1470,8 +1463,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -1509,11 +1502,11 @@
/*
* Allocate an IRP to carry the Test-Unit-Ready.
- * Allocate an extra IRP stack location
+ * Allocate an extra IRP stack location
* so we can cache our device object in the top location.
*/
irp = IoAllocateIrp((CCHAR)(fdo->StackSize+1), FALSE);
-
+
if (irp != NULL) {
PVOID buffer;
@@ -1634,7 +1627,7 @@
"ClasspInitializePolling: GESN *NOT* available
"
"for %p\n", FdoExtension->DeviceObject));
}
-
+
ASSERT(info->Gesn.Supported == 0);
ASSERT(info->Gesn.Buffer == NULL);
ASSERT(info->Gesn.BufferSize == 0);
@@ -1661,7 +1654,7 @@
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN PMEDIA_CHANGE_DETECTION_INFO Info
)
-{
+{
PNOTIFICATION_EVENT_STATUS_HEADER header;
CLASS_DETECTION_STATE detectionState = ClassDetectionUnknown;
PSTORAGE_ADAPTER_DESCRIPTOR adapterDescriptor;
@@ -1672,7 +1665,7 @@
ULONG i;
ULONG atapiResets;
-
+
PAGED_CODE();
ASSERT(Info == FdoExtension->MediaChangeDetectionInfo);
@@ -1684,7 +1677,7 @@
CLASSP_REG_SUBKEY_NAME,
CLASSP_REG_MMC_DETECTION_VALUE_NAME,
(PULONG)&detectionState);
-
+
if (detectionState == ClassDetectionUnsupported) {
goto ExitWithError;
}
@@ -1695,7 +1688,7 @@
if (TEST_FLAG(FdoExtension->PrivateFdoData->HackFlags,
FDO_HACK_GESN_IS_BAD)) {
-
+
detectionState = ClassDetectionUnsupported;
ClassSetDeviceParameter(FdoExtension,
CLASSP_REG_SUBKEY_NAME,
@@ -1707,7 +1700,7 @@
//
- // else go through the process since we allocate buffers and
+ // else go through the process since we allocate buffers and
// get all sorts of device settings.
//
@@ -1750,7 +1743,7 @@
atapiResets = 0;
retryImmediately = TRUE;
for (i = 0; i < 16 && retryImmediately == TRUE; i++) {
-
+
irp = ClasspPrepareMcnIrp(FdoExtension, Info, TRUE);
if (irp == NULL) {
status = STATUS_INSUFFICIENT_RESOURCES;
@@ -1758,19 +1751,19 @@
}
ASSERT(TEST_FLAG(Info->MediaChangeSrb.SrbFlags, SRB_FLAGS_NO_QUEUE_FREEZE));
-
+
//
// replace the completion routine with a different one this time...
//
-
+
IoSetCompletionRoutine(irp,
ClassSignalCompletion,
&event,
TRUE, TRUE, TRUE);
KeInitializeEvent(&event, SynchronizationEvent, FALSE);
-
+
status = IoCallDriver(FdoExtension->CommonExtension.LowerDeviceObject, irp);
-
+
if (status == STATUS_PENDING) {
status = KeWaitForSingleObject(&event,
Executive,
@@ -1780,7 +1773,7 @@
ASSERT(NT_SUCCESS(status));
}
ClassReleaseRemoveLock(FdoExtension->DeviceObject, irp);
-
+
if (SRB_STATUS(Info->MediaChangeSrb.SrbStatus) != SRB_STATUS_SUCCESS) {
ClassInterpretSenseInfo(FdoExtension->DeviceObject,
&(Info->MediaChangeSrb),
@@ -1815,18 +1808,18 @@
if (status == STATUS_DATA_OVERRUN) {
status = STATUS_SUCCESS;
}
-
+
if ((status == STATUS_INVALID_DEVICE_REQUEST) ||
(status == STATUS_TIMEOUT) ||
(status == STATUS_IO_DEVICE_ERROR) ||
(status == STATUS_IO_TIMEOUT)
) {
-
+
//
// with these error codes, we don't ever want to try this command
// again on this device, since it reacts poorly.
//
-
+
ClassSetDeviceParameter(FdoExtension,
CLASSP_REG_SUBKEY_NAME,
CLASSP_REG_MMC_DETECTION_VALUE_NAME,
@@ -1836,9 +1829,9 @@
status, FdoExtension->DeviceObject));
goto ExitWithError;
-
- }
-
+
+ }
+
if (!NT_SUCCESS(status)) {
//
@@ -1851,21 +1844,21 @@
status, FdoExtension->DeviceObject));
goto ExitWithError;
}
-
+
if (i == 0) {
//
// the first time, the request was just retrieving a mask of
// available bits. use this to mask future requests.
//
-
+
header = (PNOTIFICATION_EVENT_STATUS_HEADER)(Info->Gesn.Buffer);
-
+
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugMCN,
"Classpnp => Fdo %p supports event mask %x\n",
FdoExtension->DeviceObject,
header->SupportedEventClasses));
-
-
+
+
if (TEST_FLAG(header->SupportedEventClasses,
NOTIFICATION_MEDIA_STATUS_CLASS_MASK)) {
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugMCN,
@@ -1886,13 +1879,13 @@
// therefore, we should not bother querying for the other,
// unknown events. clear all but the above flags.
//
-
+
Info->Gesn.EventMask &=
NOTIFICATION_EXTERNAL_REQUEST_CLASS_MASK |
NOTIFICATION_MEDIA_STATUS_CLASS_MASK |
NOTIFICATION_DEVICE_BUSY_CLASS_MASK ;
-
-
+
+
//
// HACKHACK - REF #0001
// Some devices will *never* report an event if we've also requested
@@ -1906,7 +1899,7 @@
// drives, default to enabling the hack until we find evidence of
// proper firmware.
//
-
+
if (CountOfSetBitsUChar(Info->Gesn.EventMask) == 1) {
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugMCN,
"Classpnp => GESN hack %s for FDO %p\n",
@@ -1919,7 +1912,7 @@
}
} else {
-
+
//
// not the first time looping through, so interpret the results.
//
@@ -1942,13 +1935,13 @@
// since we also rely upon NOT_READY events to change the cursor
// into a "wait" cursor, we can't use GESN without NOT_READY support.
//
-
+
if (TEST_FLAG(Info->Gesn.EventMask,
NOTIFICATION_MEDIA_STATUS_CLASS_MASK) &&
TEST_FLAG(Info->Gesn.EventMask,
NOTIFICATION_DEVICE_BUSY_CLASS_MASK)
) {
-
+
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugMCN,
"Classpnp => Enabling GESN support for fdo %p\n",
FdoExtension->DeviceObject));
@@ -1962,7 +1955,7 @@
return STATUS_SUCCESS;
}
-
+
KdPrintEx((DPFLTR_CLASSPNP_ID, ClassDebugMCN,
"Classpnp => GESN available but not enabled for fdo %p\n",
FdoExtension->DeviceObject));
@@ -2001,18 +1994,16 @@
Arguments:
FdoExtension is the device to poll
-
+
AllowDriveToSleep says whether to attempt to allow the drive to sleep
- or not. This only affects system-known spin down states, so if a
+ or not. This only affects system-known spin down states, so if a
drive spins itself down, this has no effect until the system spins
it down.
Return Value:
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassInitializeTestUnitPolling(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN BOOLEAN AllowDriveToSleep
@@ -2031,24 +2022,22 @@
to autorun) for a given device. It will then check the device-type wide
key "Autorun" in the service key (for legacy reasons), and then look in
the device-specific key to potentially override that setting.
-
+
If MCN is to be enabled, all neccessary structures and memory are
allocated and initialized.
-
+
This routine MUST be called only from the ClassInit() callback.
Arguments:
FdoExtension - the device to initialize MCN for, if appropriate
-
+
EventPrefix - unused, legacy argument. Set to zero.
Return Value:
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassInitializeMediaChangeDetection(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN PUCHAR EventPrefix
@@ -2119,7 +2108,7 @@
if (disabled) {
return;
}
-
+
//
// if the drive is not a CDROM, allow the drive to sleep
//
@@ -2672,7 +2661,7 @@
}
ZwClose(serviceKey);
-
+
DebugPrint((ClassDebugMCN, "ClassCheckServiceMCN: "
"Autoplay for device %p is %s\n",
FdoExtension->DeviceObject,
@@ -2698,15 +2687,13 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassEnableMediaChangeDetection(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
@@ -2782,17 +2769,15 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
--*/
ULONG BreakOnMcnDisable = FALSE;
-SCSIPORTAPI
VOID
-NTAPI
ClassDisableMediaChangeDetection(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
@@ -2837,9 +2822,7 @@
Return Value:
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassCleanupMediaChangeDetection(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
@@ -2853,7 +2836,7 @@
}
FdoExtension->MediaChangeDetectionInfo = NULL;
-
+
if (info->Gesn.Buffer) {
ExFreePool(info->Gesn.Buffer);
}
@@ -2873,8 +2856,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -3067,8 +3050,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -3214,8 +3197,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -3264,8 +3247,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -3317,8 +3300,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -3450,9 +3433,7 @@
Return Value:
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassNotifyFailurePredicted(
PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
PUCHAR Buffer,
@@ -3535,9 +3516,7 @@
NT Status
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassSetFailurePredictionPoll(
PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
FAILURE_PREDICTION_METHOD FailurePredictionMethod,
Modified: branches/cmake-bringup/drivers/storage/classpnp/class.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/c…
==============================================================================
--- branches/cmake-bringup/drivers/storage/classpnp/class.c [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/storage/classpnp/class.c [iso-8859-1] Sun Oct 31
10:42:40 2010
@@ -115,9 +115,7 @@
A valid return code for a DriverEntry routine.
--*/
-SCSIPORTAPI
ULONG
-NTAPI
ClassInitialize(
IN PVOID Argument1,
IN PVOID Argument2,
@@ -132,7 +130,7 @@
NTSTATUS status;
PAGED_CODE();
-
+
DebugPrint((3,"\n\nSCSI Class Driver\n"));
ClasspInitializeDebugGlobals();
@@ -363,9 +361,7 @@
Status Code
--*/
-SCSIPORTAPI
ULONG
-NTAPI
ClassInitializeEx(
IN PDRIVER_OBJECT DriverObject,
IN LPGUID Guid,
@@ -1729,10 +1725,7 @@
Status is returned.
--*/
-SCSIPORTAPI
-NTSTATUS
-NTAPI
-ClassReadDriveCapacity(IN PDEVICE_OBJECT Fdo)
+NTSTATUS ClassReadDriveCapacity(IN PDEVICE_OBJECT Fdo)
{
READ_CAPACITY_DATA readCapacityBuffer = {0};
NTSTATUS status;
@@ -2015,9 +2008,7 @@
None.
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassSendStartUnit(
IN PDEVICE_OBJECT Fdo
)
@@ -2170,9 +2161,7 @@
None.
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassAsynchronousCompletion(
PDEVICE_OBJECT DeviceObject,
PIRP Irp,
@@ -2438,9 +2427,7 @@
NT status
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassIoComplete(
IN PDEVICE_OBJECT Fdo,
IN PIRP Irp,
@@ -2656,9 +2643,7 @@
Srb->DataTransferLength
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassSendSrbSynchronous(
PDEVICE_OBJECT Fdo,
PSCSI_REQUEST_BLOCK Srb,
@@ -3004,9 +2989,7 @@
FALSE: Drivers should not retry this request.
--*/
-SCSIPORTAPI
BOOLEAN
-NTAPI
ClassInterpretSenseInfo(
IN PDEVICE_OBJECT Fdo,
IN PSCSI_REQUEST_BLOCK Srb,
@@ -4070,7 +4053,7 @@
/*
* If logError is set, also save this log in the system's error log.
- * But make sure we don't log TUR failures over and over
+ * But make sure we don't log TUR failures over and over
* (e.g. if an external drive was switched off and we're still sending
TUR's to it every second).
*/
if ((((PCDB)Srb->Cdb)->CDB10.OperationCode == SCSIOP_TEST_UNIT_READY)
&& logError){
@@ -4078,7 +4061,7 @@
logError = FALSE;
}
else {
- fdoData->LoggedTURFailureSinceLastIO = TRUE;
+ fdoData->LoggedTURFailureSinceLastIO = TRUE;
}
}
if (logError){
@@ -4137,10 +4120,7 @@
Length of the transferred data is returned.
--*/
-SCSIPORTAPI
-ULONG
-NTAPI
-ClassModeSense( IN PDEVICE_OBJECT Fdo,
+ULONG ClassModeSense( IN PDEVICE_OBJECT Fdo,
IN PCHAR ModeSenseBuffer,
IN ULONG Length,
IN UCHAR PageMode)
@@ -4226,9 +4206,7 @@
then NULL is return.
--*/
-SCSIPORTAPI
PVOID
-NTAPI
ClassFindModePage(
IN PCHAR ModeSenseBuffer,
IN ULONG Length,
@@ -4339,9 +4317,7 @@
or returns a status value to indicate why it failed.
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassSendSrbAsynchronous(
PDEVICE_OBJECT Fdo,
PSCSI_REQUEST_BLOCK Srb,
@@ -4609,9 +4585,7 @@
Returns back a STATUS_PENDING or a completion status.
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassDeviceControl(
PDEVICE_OBJECT DeviceObject,
PIRP Irp
@@ -5634,7 +5608,6 @@
--*/
NTSTATUS
-NTAPI
ClassShutdownFlush(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
@@ -5707,9 +5680,7 @@
NTSTATUS
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassCreateDeviceObject(
IN PDRIVER_OBJECT DriverObject,
IN PCCHAR ObjectNameBuffer,
@@ -6006,9 +5977,7 @@
Returns a status indicating success or failure of the operation.
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassClaimDevice(
IN PDEVICE_OBJECT LowerDeviceObject,
IN BOOLEAN Release
@@ -6139,9 +6108,7 @@
Returns back a STATUS_PENDING or a completion status.
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassInternalIoControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
@@ -6213,9 +6180,7 @@
None, but it sets a new default timeout for a class of devices.
--*/
-SCSIPORTAPI
ULONG
-NTAPI
ClassQueryTimeOutRegistryValue(
IN PDEVICE_OBJECT DeviceObject
)
@@ -6322,9 +6287,7 @@
NT status
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassCheckVerifyComplete(
IN PDEVICE_OBJECT Fdo,
IN PIRP Irp,
@@ -6389,9 +6352,7 @@
buffer allocated on behalf of the caller.
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassGetDescriptor(
IN PDEVICE_OBJECT DeviceObject,
IN PSTORAGE_PROPERTY_ID PropertyId,
@@ -6540,9 +6501,7 @@
STATUS_MORE_PROCESSING_REQUIRED
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassSignalCompletion(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
@@ -6629,9 +6588,7 @@
None
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassMarkChildrenMissing(
IN PFUNCTIONAL_DEVICE_EXTENSION Fdo
)
@@ -6683,9 +6640,7 @@
to PNP.
--*/
-SCSIPORTAPI
BOOLEAN
-NTAPI
ClassMarkChildMissing(
IN PPHYSICAL_DEVICE_EXTENSION Child,
IN BOOLEAN AcquireChildLock
@@ -6939,9 +6894,7 @@
none
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassInvalidateBusRelations(
IN PDEVICE_OBJECT Fdo
)
@@ -6996,9 +6949,7 @@
status
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassRemoveDevice(
IN PDEVICE_OBJECT DeviceObject,
IN UCHAR RemoveType
@@ -7262,9 +7213,7 @@
Either NULL if none, or a pointer to the driver extension
--*/
-SCSIPORTAPI
PCLASS_DRIVER_EXTENSION
-NTAPI
ClassGetDriverExtension(
IN PDRIVER_OBJECT DriverObject
)
@@ -7348,9 +7297,7 @@
None
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassUpdateInformationInRegistry(
IN PDEVICE_OBJECT Fdo,
IN PCHAR DeviceName,
@@ -7687,9 +7634,7 @@
Return Value:
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassSendDeviceIoControlSynchronous(
IN ULONG IoControlCode,
IN PDEVICE_OBJECT TargetDeviceObject,
@@ -7946,9 +7891,7 @@
Return Value:
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassForwardIrpSynchronous(
IN PCOMMON_DEVICE_EXTENSION CommonExtension,
IN PIRP Irp
@@ -7977,9 +7920,7 @@
Return Value:
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassSendIrpSynchronous(
IN PDEVICE_OBJECT TargetDeviceObject,
IN PIRP Irp
@@ -8078,9 +8019,7 @@
the VPB, or NULL if none.
--*/
-SCSIPORTAPI
PVPB
-NTAPI
ClassGetVpb(
IN PDEVICE_OBJECT DeviceObject
)
@@ -8189,9 +8128,7 @@
None.
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassReleaseQueue(
IN PDEVICE_OBJECT Fdo
)
@@ -8511,9 +8448,7 @@
None
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassAcquireChildLock(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
@@ -8555,9 +8490,7 @@
None.
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassReleaseChildLock(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
Modified: branches/cmake-bringup/drivers/storage/classpnp/classp.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/c…
==============================================================================
--- branches/cmake-bringup/drivers/storage/classpnp/classp.h [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/storage/classpnp/classp.h [iso-8859-1] Sun Oct 31
10:42:40 2010
@@ -424,7 +424,7 @@
BOOLEAN TimerStarted;
BOOLEAN LoggedTURFailureSinceLastIO;
-
+
//
// privately allocated release queue irp
// protected by fdoExtension->ReleaseQueueSpinLock
@@ -508,7 +508,6 @@
}
NTSTATUS
-NTAPI
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
@@ -557,6 +556,12 @@
);
NTSTATUS
+ClassDeviceControl(
+ PDEVICE_OBJECT DeviceObject,
+ PIRP Irp
+ );
+
+NTSTATUS
ClassDispatchPnp(
PDEVICE_OBJECT DeviceObject,
PIRP Irp
@@ -568,7 +573,12 @@
);
NTSTATUS
-NTAPI
+ClassInternalIoControl (
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp
+ );
+
+NTSTATUS
ClassShutdownFlush(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
Modified: branches/cmake-bringup/drivers/storage/classpnp/classwmi.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/c…
==============================================================================
--- branches/cmake-bringup/drivers/storage/classpnp/classwmi.c [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/storage/classpnp/classwmi.c [iso-8859-1] Sun Oct 31
10:42:40 2010
@@ -256,14 +256,14 @@
ClassQueryWmiRegInfoEx = commonExtension->IsFdo ?
driverExtension->ClassFdoQueryWmiRegInfoEx :
driverExtension->ClassPdoQueryWmiRegInfoEx;
-
+
if (ClassQueryWmiRegInfoEx == NULL)
{
status = classWmiInfo->ClassQueryWmiRegInfo(
DeviceObject,
&nameFlags,
&name);
-
+
RtlInitUnicodeString(&mofName, MOFRESOURCENAME);
} else {
RtlInitUnicodeString(&mofName, L"");
@@ -545,13 +545,13 @@
DeviceObject - Supplies a pointer to the device object for this request.
Irp - Supplies the Irp making the request.
-
+
Status - Status to complete the irp with. STATUS_BUFFER_TOO_SMALL is used
to indicate that more buffer is required for the data requested.
-
+
BufferUsed - number of bytes of actual data to return (not including WMI
specific structures)
-
+
PriorityBoost - priority boost to pass to ClassCompleteRequest
Return Value:
@@ -561,7 +561,6 @@
--*/
SCSIPORTAPI
NTSTATUS
-NTAPI
ClassWmiCompleteRequest(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
@@ -725,9 +724,7 @@
status
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassWmiFireEvent(
IN PDEVICE_OBJECT DeviceObject,
IN LPGUID Guid,
Modified: branches/cmake-bringup/drivers/storage/classpnp/lock.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/c…
==============================================================================
--- branches/cmake-bringup/drivers/storage/classpnp/lock.c [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/storage/classpnp/lock.c [iso-8859-1] Sun Oct 31
10:42:40 2010
@@ -78,9 +78,7 @@
lock.
--*/
-SCSIPORTAPI
ULONG
-NTAPI
ClassAcquireRemoveLockEx(
IN PDEVICE_OBJECT DeviceObject,
IN OPTIONAL PVOID Tag,
@@ -125,14 +123,14 @@
&oldIrql);
commonExtension->RemoveTrackingUntrackedCount++;
-
+
DebugPrint((ClassDebugWarning,
">>>>>ClassAcquireRemoveLock: "
"Cannot track Tag %p - currently %d untracked
requsts\n",
Tag, commonExtension->RemoveTrackingUntrackedCount));
KeReleaseSpinLock(&commonExtension->RemoveTrackingSpinlock,
oldIrql);
- }
+ }
else {
PREMOVE_TRACKING_BLOCK *removeTrackingList =
(PREMOVE_TRACKING_BLOCK)&commonExtension->RemoveTrackingList;
@@ -210,9 +208,7 @@
none
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassReleaseRemoveLock(
IN PDEVICE_OBJECT DeviceObject,
IN OPTIONAL PIRP Tag
@@ -365,9 +361,9 @@
Arguments:
DeviceObject - the device object that was handling this request
-
+
Irp - the irp to be completed by IoCompleteRequest
-
+
PriorityBoost - the priority boost to pass to IoCompleteRequest
Return Value:
@@ -375,9 +371,7 @@
none
--*/
-SCSIPORTAPI
VOID
-NTAPI
ClassCompleteRequest(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
Modified: branches/cmake-bringup/drivers/storage/classpnp/obsolete.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/c…
==============================================================================
--- branches/cmake-bringup/drivers/storage/classpnp/obsolete.c [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/storage/classpnp/obsolete.c [iso-8859-1] Sun Oct 31
10:42:40 2010
@@ -51,10 +51,7 @@
* StartIo routine when the transfer size is too large for the hardware.
* We map it to our new read/write handler.
*/
-SCSIPORTAPI
-VOID
-NTAPI
-ClassSplitRequest(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN ULONG MaximumBytes)
+VOID ClassSplitRequest(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN ULONG MaximumBytes)
{
PFUNCTIONAL_DEVICE_EXTENSION fdoExt = Fdo->DeviceExtension;
PCLASS_PRIVATE_FDO_DATA fdoData = fdoExt->PrivateFdoData;
@@ -71,7 +68,7 @@
}
ServiceTransferRequest(Fdo, Irp);
-}
+}
/*++////////////////////////////////////////////////////////////////////////////
@@ -102,9 +99,7 @@
NT status
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassIoCompleteAssociated(
IN PDEVICE_OBJECT Fdo,
IN PIRP Irp,
@@ -481,9 +476,7 @@
NT Status
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassBuildRequest(
PDEVICE_OBJECT Fdo,
PIRP Irp
@@ -746,13 +739,13 @@
DBGWARN(("ClasspInsertCScanList is OBSOLETE !"));
//
- // Iterate through the list. Insert this entry in the sorted list in
- // order (after other requests for the same block). At each stop if
+ // Iterate through the list. Insert this entry in the sorted list in
+ // order (after other requests for the same block). At each stop if
// blockNumber(Entry) >= blockNumber(t) then move on.
//
- for(t = (PCSCAN_LIST_ENTRY) ListHead->Flink;
- t != (PCSCAN_LIST_ENTRY) ListHead;
+ for(t = (PCSCAN_LIST_ENTRY) ListHead->Flink;
+ t != (PCSCAN_LIST_ENTRY) ListHead;
t = (PCSCAN_LIST_ENTRY) t->Entry.Flink) {
if(Entry->BlockNumber < t->BlockNumber) {
@@ -775,7 +768,7 @@
}
//
- // Insert this entry at the tail of the list. If the list was empty this
+ // Insert this entry at the tail of the list. If the list was empty this
// will also be the head of the list.
//
@@ -794,25 +787,25 @@
to the access of the list.
Low priority requests are always scheduled to run on the next sweep across
- the disk. Normal priority requests will be inserted into the current or
+ the disk. Normal priority requests will be inserted into the current or
next sweep based on the standard C-SCAN algorithm.
Arguments:
List - the list to insert into
-
+
Irp - the irp to be inserted.
-
+
BlockNumber - the block number for this request.
-
- LowPriority - indicates that the request is lower priority and should be
- done on the next sweep across the disk.
+
+ LowPriority - indicates that the request is lower priority and should be
+ done on the next sweep across the disk.
Return Value:
none
-
---*/
+
+--*/
{
PCSCAN_LIST_ENTRY entry = (PCSCAN_LIST_ENTRY)Irp->Tail.Overlay.DriverContext;
@@ -824,7 +817,7 @@
entry->BlockNumber = BlockNumber;
//
- // If it's a normal priority request and further down the disk than our
+ // If it's a normal priority request and further down the disk than our
// current position then insert this entry into the current sweep.
//
@@ -845,22 +838,22 @@
Routine Description:
- This routine will attempt to reuse the provided SRB to start a blocked
- read/write request.
+ This routine will attempt to reuse the provided SRB to start a blocked
+ read/write request.
If there is no need to reuse the request it will be returned
to the SRB lookaside list.
Arguments:
Fdo - the device extension
-
+
Srb - the SRB which is to be reused or freed.
-
+
Return Value:
none.
-
---*/
+
+--*/
{
PCLASS_PRIVATE_FDO_DATA privateData = FdoExtension->PrivateFdoData;
@@ -876,7 +869,7 @@
// memory leak.
//
ASSERT(!TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER));
-
+
if (commonExt->IsSrbLookasideListInitialized){
/*
* Put the SRB back in our lookaside list.
@@ -903,7 +896,7 @@
This routine deletes a lookaside listhead for srbs, and should be called
only during the final removal.
-
+
If called at other times, the caller is responsible for
synchronization and removal issues.
@@ -916,10 +909,7 @@
None
--*/
-SCSIPORTAPI
-VOID
-NTAPI
-ClassDeleteSrbLookasideList(IN PCOMMON_DEVICE_EXTENSION CommonExtension)
+VOID ClassDeleteSrbLookasideList(IN PCOMMON_DEVICE_EXTENSION CommonExtension)
{
PAGED_CODE();
@@ -933,7 +923,7 @@
else {
DBGWARN(("ClassDeleteSrbLookasideList: attempt to delete uninitialized or
freed srblookasidelist"));
}
-}
+}
/*++////////////////////////////////////////////////////////////////////////////
@@ -944,7 +934,7 @@
This routine sets up a lookaside listhead for srbs, and should be called
only from the ClassInitDevice() routine to prevent race conditions.
-
+
If called from other locations, the caller is responsible for
synchronization and removal issues.
@@ -954,7 +944,7 @@
NumberElements - Supplies the maximum depth of the lookaside list.
-
+
Note:
The Windows 2000 version of classpnp did not return any status value from
@@ -962,10 +952,7 @@
--*/
-SCSIPORTAPI
-VOID
-NTAPI
-ClassInitializeSrbLookasideList( IN PCOMMON_DEVICE_EXTENSION CommonExtension,
+VOID ClassInitializeSrbLookasideList( IN PCOMMON_DEVICE_EXTENSION CommonExtension,
IN ULONG NumberElements)
{
PAGED_CODE();
@@ -986,8 +973,8 @@
CommonExtension->IsSrbLookasideListInitialized = TRUE;
}
-
-}
+
+}
@@ -1021,7 +1008,7 @@
List->CurrentSweep = List->NextSweep;
//
- // Unlink the next sweep list from the list head now that we have a copy
+ // Unlink the next sweep list from the list head now that we have a copy
// of it.
//
Modified: branches/cmake-bringup/drivers/storage/classpnp/power.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/c…
==============================================================================
--- branches/cmake-bringup/drivers/storage/classpnp/power.c [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/storage/classpnp/power.c [iso-8859-1] Sun Oct 31
10:42:40 2010
@@ -77,8 +77,8 @@
Arguments:
- DeviceObject -
- Irp -
+ DeviceObject -
+ Irp -
Return Value:
@@ -151,7 +151,7 @@
STATUS_MORE_PROCESSING_REQUIRED or
STATUS_SUCCESS
-
+
--*/
NTSTATUS
ClasspPowerUpCompletion(
@@ -389,7 +389,7 @@
break;
}
-
+
// reset retries
Context->RetryCount = MAXIMUM_RETRIES;
@@ -406,7 +406,7 @@
Context->Srb.SrbFlags = SRB_FLAGS_BYPASS_LOCKED_QUEUE;
Context->Srb.SrbStatus = Context->Srb.ScsiStatus = 0;
Context->Srb.DataTransferLength = 0;
-
+
nextStack->Parameters.Scsi.Srb = &(Context->Srb);
nextStack->MajorFunction = IRP_MJ_SCSI;
@@ -466,7 +466,7 @@
// Indicate to Po that we've been successfully powered up so
// it can do it's notification stuff.
//
-
+
PoSetPowerState(DeviceObject,
currentStack->Parameters.Power.Type,
currentStack->Parameters.Power.State);
@@ -623,45 +623,45 @@
//
// send SCSIOP_SYNCHRONIZE_CACHE
//
-
+
Context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK);
Context->Srb.Function = SRB_FUNCTION_EXECUTE_SCSI;
-
+
Context->Srb.TimeOutValue = fdoExtension->TimeOutValue;
-
+
Context->Srb.SrbFlags = SRB_FLAGS_NO_DATA_TRANSFER |
SRB_FLAGS_DISABLE_AUTOSENSE |
SRB_FLAGS_DISABLE_SYNCH_TRANSFER |
SRB_FLAGS_NO_QUEUE_FREEZE |
SRB_FLAGS_BYPASS_LOCKED_QUEUE;
-
+
Context->Srb.SrbStatus = Context->Srb.ScsiStatus = 0;
Context->Srb.DataTransferLength = 0;
-
+
Context->Srb.CdbLength = 10;
-
+
cdb = (PCDB) Context->Srb.Cdb;
-
+
RtlZeroMemory(cdb, sizeof(CDB));
cdb->SYNCHRONIZE_CACHE10.OperationCode = SCSIOP_SYNCHRONIZE_CACHE;
-
+
IoSetCompletionRoutine(Irp,
ClasspPowerDownCompletion,
Context,
TRUE,
TRUE,
TRUE);
-
+
nextStack->Parameters.Scsi.Srb = &(Context->Srb);
nextStack->MajorFunction = IRP_MJ_SCSI;
-
+
status = IoCallDriver(commonExtension->LowerDeviceObject, Irp);
-
+
DebugPrint((1, "(%p)\tIoCallDriver returned %lx\n", Irp,
status));
break;
-
+
} else {
-
+
DebugPrint((1, "(%p)\tPower Down: not sending SYNCH_CACHE\n",
DeviceObject));
Context->PowerChangeState.PowerDown2++;
@@ -671,7 +671,7 @@
// no break in case the device doesn't like synch_cache commands
}
-
+
case PowerDownDeviceFlushed2: {
PCDB cdb;
@@ -843,9 +843,9 @@
//
if (!NT_SUCCESS(status)) {
-
+
PSENSE_DATA senseBuffer = Context->Srb.SenseInfoBuffer;
-
+
if (TEST_FLAG(Context->Srb.SrbStatus,
SRB_STATUS_AUTOSENSE_VALID) &&
((senseBuffer->SenseKey & 0xf) == SCSI_SENSE_NOT_READY)
&&
@@ -881,7 +881,7 @@
DebugPrint((1, "(%p)\tPoCallDriver returned %lx\n", Irp,
status));
break;
}
-
+
// else fall through w/o sending the power irp, since the device
// is reporting an error that would be "really bad" to power down
// during.
@@ -900,7 +900,7 @@
if (Context->QueueLocked) {
DebugPrint((1, "(%p)\tUnlocking queue\n", Irp));
-
+
Context->Srb.Length = sizeof(SCSI_REQUEST_BLOCK);
Context->Srb.SrbStatus = Context->Srb.ScsiStatus = 0;
@@ -956,7 +956,7 @@
Irp->IoStatus.Information = 0;
if (NT_SUCCESS(status)) {
-
+
//
// Set the new power state
//
@@ -989,7 +989,7 @@
This routine reduces the number of useless spinups and spindown requests
sent to a given device by ignoring transitions to power states we are
currently in.
-
+
ISSUE-2000/02/20-henrygab - by ignoring spin-up requests, we may be
allowing the drive
@@ -1046,7 +1046,7 @@
irpStack->Parameters.Power.State.SystemState));
switch (irpStack->Parameters.Power.ShutdownType){
-
+
case PowerActionSleep:
case PowerActionHibernate:
if (fdoData->HotplugInfo.MediaRemovable ||
fdoData->HotplugInfo.MediaHotplug){
@@ -1060,7 +1060,7 @@
}
break;
}
-
+
break;
}
@@ -1311,7 +1311,7 @@
if (DeviceObject->Characteristics & FILE_REMOVABLE_MEDIA) {
- PFUNCTIONAL_DEVICE_EXTENSION fdoExtension =
+ PFUNCTIONAL_DEVICE_EXTENSION fdoExtension =
DeviceObject->DeviceExtension;
//
@@ -1319,9 +1319,9 @@
//
if (irpStack->MinorFunction == IRP_MN_SET_POWER){
PVPB vpb;
-
+
switch (irpStack->Parameters.Power.ShutdownType){
-
+
case PowerActionSleep:
case PowerActionHibernate:
//
@@ -1331,11 +1331,11 @@
//
vpb = ClassGetVpb(fdoExtension->DeviceObject);
if (vpb && (vpb->Flags & VPB_MOUNTED)){
- SET_FLAG(fdoExtension->DeviceObject->Flags,
DO_VERIFY_VOLUME);
- }
+ SET_FLAG(fdoExtension->DeviceObject->Flags,
DO_VERIFY_VOLUME);
+ }
break;
}
- }
+ }
}
IoCopyCurrentIrpStackLocationToNext(Irp);
@@ -1345,7 +1345,7 @@
if (irpStack->MinorFunction != IRP_MN_SET_POWER &&
irpStack->MinorFunction != IRP_MN_QUERY_POWER) {
-
+
NOTHING;
} else {
@@ -1371,7 +1371,7 @@
a start and a stop to be sent to the device. (actually the starts are
almost always optional, since most device power themselves on to process
commands, but i digress).
-
+
Determines proper use of spinup, spindown, and queue locking based upon
ScanForSpecialFlags in the FdoExtension. This is the most common power
handler passed into classpnp.sys
@@ -1387,9 +1387,7 @@
None
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassSpinDownPowerHandler(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
@@ -1451,14 +1449,12 @@
This routine is an outdated call. To achieve equivalent functionality,
the driver should set the following flags in ScanForSpecialFlags in the
FdoExtension:
-
+
CLASS_SPECIAL_DISABLE_SPIN_UP
CLASS_SPECIAL_NO_QUEUE_LOCK
--*/
-SCSIPORTAPI
NTSTATUS
-NTAPI
ClassStopUnitPowerHandler(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
Modified: branches/cmake-bringup/drivers/storage/classpnp/utils.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/drivers/storage/c…
==============================================================================
--- branches/cmake-bringup/drivers/storage/classpnp/utils.c [iso-8859-1] (original)
+++ branches/cmake-bringup/drivers/storage/classpnp/utils.c [iso-8859-1] Sun Oct 31
10:42:40 2010
@@ -55,10 +55,7 @@
}
-SCSIPORTAPI
-VOID
-NTAPI
-ClassGetDeviceParameter(
+VOID ClassGetDeviceParameter(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN PWSTR SubkeyName OPTIONAL,
IN PWSTR ParameterName,
@@ -143,10 +140,7 @@
} // end ClassGetDeviceParameter()
-SCSIPORTAPI
-NTSTATUS
-NTAPI
-ClassSetDeviceParameter(
+NTSTATUS ClassSetDeviceParameter(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN PWSTR SubkeyName OPTIONAL,
IN PWSTR ParameterName,
@@ -224,10 +218,7 @@
* hardware based upon id strings. it does not check the registry.
*/
-SCSIPORTAPI
-VOID
-NTAPI
-ClassScanForSpecial(
+VOID ClassScanForSpecial(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN CLASSPNP_SCAN_FOR_SPECIAL_INFO DeviceList[],
IN PCLASS_SCAN_FOR_SPECIAL_HANDLER Function)