diff options
| author | Dave Wilson <[email protected]> | 2015-04-29 09:48:49 -0700 |
|---|---|---|
| committer | Dave Wilson <[email protected]> | 2015-04-29 10:47:29 -0700 |
| commit | d40232638faaab19de557e70a3ee938da7a35295 (patch) | |
| tree | 14e61c973745949af186b7940e3a53d25322f5de /storage/class/classpnp/src | |
| parent | 02e5b090a6131a7cc1b90f4a9373117c9e3c7088 (diff) | |
samples update for //build
Diffstat (limited to 'storage/class/classpnp/src')
| -rw-r--r-- | storage/class/classpnp/src/classp.h | 2 | ||||
| -rw-r--r-- | storage/class/classpnp/src/classpnp.vcxproj | 4 | ||||
| -rw-r--r-- | storage/class/classpnp/src/classpnp.vcxproj.Filters | 8 | ||||
| -rw-r--r-- | storage/class/classpnp/src/utils.c | 17 | ||||
| -rw-r--r-- | storage/class/classpnp/src/xferpkt.c | 14 |
5 files changed, 21 insertions, 24 deletions
diff --git a/storage/class/classpnp/src/classp.h b/storage/class/classpnp/src/classp.h index 3c32c25d..b46b2d8b 100644 --- a/storage/class/classpnp/src/classp.h +++ b/storage/class/classpnp/src/classp.h @@ -355,7 +355,7 @@ typedef struct _MEDIA_CHANGE_DETECTION_INFO { // UCHAR SenseBufferLength; -}; +} MEDIA_CHANGE_DETECTION_INFO, *PMEDIA_CHANGE_DETECTION_INFO; typedef enum { SimpleMediaLock, diff --git a/storage/class/classpnp/src/classpnp.vcxproj b/storage/class/classpnp/src/classpnp.vcxproj index 1a18fbc8..ca387b67 100644 --- a/storage/class/classpnp/src/classpnp.vcxproj +++ b/storage/class/classpnp/src/classpnp.vcxproj @@ -19,12 +19,12 @@ </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> - <ProjectGuid>{6AEA931E-5110-494C-A1DB-9FDE40CE7133}</ProjectGuid> + <ProjectGuid>{A5AC0FD0-F93F-4FAD-940A-704DF40D9283}</ProjectGuid> <RootNamespace>$(MSBuildProjectName)</RootNamespace> <SupportsPackaging>false</SupportsPackaging> <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> <Platform Condition="'$(Platform)' == ''">Win32</Platform> - <SampleGuid>{FDD23D45-9A28-4A9B-8C8A-3B388DEAC852}</SampleGuid> + <SampleGuid>{36EE04FE-C8BB-410A-90C6-DD06D6865FAF}</SampleGuid> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> diff --git a/storage/class/classpnp/src/classpnp.vcxproj.Filters b/storage/class/classpnp/src/classpnp.vcxproj.Filters index 4ee10b9f..a0c56993 100644 --- a/storage/class/classpnp/src/classpnp.vcxproj.Filters +++ b/storage/class/classpnp/src/classpnp.vcxproj.Filters @@ -3,19 +3,19 @@ <ItemGroup> <Filter Include="Source Files"> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions> - <UniqueIdentifier>{30C77614-BC54-48A1-B49D-DA6B50452C12}</UniqueIdentifier> + <UniqueIdentifier>{1400A9A1-2ED5-462A-A94C-FCE810F5566E}</UniqueIdentifier> </Filter> <Filter Include="Header Files"> <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - <UniqueIdentifier>{289E064C-1506-47AC-86D9-854F5A784947}</UniqueIdentifier> + <UniqueIdentifier>{5BE1D83C-D225-42F8-AA81-E3E4C5A7200D}</UniqueIdentifier> </Filter> <Filter Include="Resource Files"> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions> - <UniqueIdentifier>{7085ABD8-FCBB-43B4-993A-2B3187FFA33E}</UniqueIdentifier> + <UniqueIdentifier>{29F75A8E-F140-40BB-A154-FCC5F6584668}</UniqueIdentifier> </Filter> <Filter Include="Driver Files"> <Extensions>inf;inv;inx;mof;mc;</Extensions> - <UniqueIdentifier>{26B13FCD-BE1B-4A53-B538-39878886CB7C}</UniqueIdentifier> + <UniqueIdentifier>{EA1725C9-0F85-48DD-8BB8-7234C2DDF3FA}</UniqueIdentifier> </Filter> </ItemGroup> <ItemGroup> diff --git a/storage/class/classpnp/src/utils.c b/storage/class/classpnp/src/utils.c index f8236c68..b503f890 100644 --- a/storage/class/classpnp/src/utils.c +++ b/storage/class/classpnp/src/utils.c @@ -8128,8 +8128,6 @@ retry: if ((firmwareInfo->Version < sizeof(STORAGE_HW_FIRMWARE_INFO)) || (firmwareInfo->Size < sizeof(STORAGE_HW_FIRMWARE_INFO)) || (firmwareInfo->SlotCount == 0) || - (firmwareInfo->ActiveSlot >= firmwareInfo->SlotCount) || - ((firmwareInfo->PendingActivateSlot >= firmwareInfo->SlotCount) && (firmwareInfo->PendingActivateSlot != STORAGE_HW_FIRMWARE_INVALID_SLOT)) || (firmwareInfo->ImagePayloadMaxSize > fdoExtension->AdapterDescriptor->MaximumTransferLength)) { oldState = InterlockedCompareExchange((PLONG)(&fdoExtension->FunctionSupportInfo->HwFirmwareGetInfoSupport), (LONG)NotSupported, (ULONG)SupportUnknown); @@ -8493,7 +8491,8 @@ ClassDeviceHwFirmwareDownloadProcess( // // Validate the device support // - if (fdoExtension->FunctionSupportInfo->HwFirmwareInfo->SupportUpgrade == FALSE) { + if ((fdoExtension->FunctionSupportInfo->HwFirmwareInfo->SupportUpgrade == FALSE) || + (fdoExtension->FunctionSupportInfo->HwFirmwareInfo->ImagePayloadAlignment == 0)) { status = STATUS_NOT_SUPPORTED; goto Exit_Firmware_Download; } @@ -8538,9 +8537,9 @@ ClassDeviceHwFirmwareDownloadProcess( // if (((ULONG_PTR)firmwareDownload->ImageBuffer % fdoExtension->FunctionSupportInfo->HwFirmwareInfo->ImagePayloadAlignment) != 0) { // - // Allocate buffer aligns to PAGE_SIZE to accommodate any alignment requirement. + // Allocate buffer aligns to ImagePayloadAlignment to accommodate the alignment requirement. // - bufferSize = ALIGN_UP_BY(firmwareDownload->BufferSize, PAGE_SIZE); + bufferSize = ALIGN_UP_BY(firmwareDownload->BufferSize, fdoExtension->FunctionSupportInfo->HwFirmwareInfo->ImagePayloadAlignment); #pragma prefast(suppress:6014, "The allocated memory that firmwareImageBuffer points to will be freed in ClassHwFirmwareDownloadComplete().") firmwareImageBuffer = ExAllocatePoolWithTag(NonPagedPoolNx, bufferSize, CLASSPNP_POOL_TAG_FIRMWARE); @@ -8631,9 +8630,9 @@ ClassDeviceHwFirmwareDownloadProcess( cdb->WRITE_BUFFER.BufferOffset[1] = *((PCHAR)&firmwareDownload->Offset + 1); cdb->WRITE_BUFFER.BufferOffset[2] = *((PCHAR)&firmwareDownload->Offset); - cdb->WRITE_BUFFER.ParameterListLength[0] = *((PCHAR)&firmwareDownload->BufferSize + 2); - cdb->WRITE_BUFFER.ParameterListLength[1] = *((PCHAR)&firmwareDownload->BufferSize + 1); - cdb->WRITE_BUFFER.ParameterListLength[2] = *((PCHAR)&firmwareDownload->BufferSize); + cdb->WRITE_BUFFER.ParameterListLength[0] = *((PCHAR)&bufferSize + 2); + cdb->WRITE_BUFFER.ParameterListLength[1] = *((PCHAR)&bufferSize + 1); + cdb->WRITE_BUFFER.ParameterListLength[2] = *((PCHAR)&bufferSize); // // Send as a tagged command. @@ -8902,5 +8901,3 @@ Exit_Firmware_Activate: FREE_POOL(Srb); return status; } - - diff --git a/storage/class/classpnp/src/xferpkt.c b/storage/class/classpnp/src/xferpkt.c index e4a051ed..159a59b3 100644 --- a/storage/class/classpnp/src/xferpkt.c +++ b/storage/class/classpnp/src/xferpkt.c @@ -144,12 +144,12 @@ NTSTATUS InitializeTransferPackets(PDEVICE_OBJECT Fdo) minWorkingSetTransferPackets = MIN_WORKINGSET_TRANSFER_PACKETS_Client; - // Note: the reason we use max here is to guarantee a reasonable large max number + // Note: the reason we use max here is to guarantee a reasonable large max number // in the case where the port driver may return a very small supported outstanding // IOs. For example, even EMMC drive only reports 1 outstanding IO supported, we - // may still want to set this value to be at least + // may still want to set this value to be at least // MAX_WORKINGSET_TRANSFER_PACKETS_Client. - maxWorkingSetTransferPackets = max(MAX_WORKINGSET_TRANSFER_PACKETS_Client, + maxWorkingSetTransferPackets = max(MAX_WORKINGSET_TRANSFER_PACKETS_Client, 2 * maxOutstandingIOPerLUN); } else { @@ -161,12 +161,12 @@ NTSTATUS InitializeTransferPackets(PDEVICE_OBJECT Fdo) // In other words, the minWorkingSetTransferPackets for server will always between // MIN_WORKINGSET_TRANSFER_PACKETS_Server_LowerBound and MIN_WORKINGSET_TRANSFER_PACKETS_Server_UpperBound - minWorkingSetTransferPackets = - max(MIN_WORKINGSET_TRANSFER_PACKETS_Server_LowerBound, - min(MIN_WORKINGSET_TRANSFER_PACKETS_Server_UpperBound, + minWorkingSetTransferPackets = + max(MIN_WORKINGSET_TRANSFER_PACKETS_Server_LowerBound, + min(MIN_WORKINGSET_TRANSFER_PACKETS_Server_UpperBound, maxOutstandingIOPerLUN)); - maxWorkingSetTransferPackets = max(MAX_WORKINGSET_TRANSFER_PACKETS_Server, + maxWorkingSetTransferPackets = max(MAX_WORKINGSET_TRANSFER_PACKETS_Server, 2 * maxOutstandingIOPerLUN); } |
