From 3b7f0a488be0ca7a2a8e4c352b0e10496bee9530 Mon Sep 17 00:00:00 2001 From: Feng Tian Date: Thu, 23 Apr 2015 01:42:57 +0000 Subject: [PATCH] MdeModulePkg/ScsiDisk: Set correct value to the Media->IoAlign field of BlockIo protocol instance. Media->IoAlign field of BlockIo protocol instance installed by this driver should be set to the value of ScsiIo->IoAlign. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian Reviewed-by: Star Zeng git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17195 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c index b9ee43bb34..21da985dd4 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c +++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c @@ -1,7 +1,7 @@ /** @file SCSI disk driver that layers on every SCSI IO protocol in the system. -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -230,15 +230,16 @@ ScsiDiskDriverBindingStart ( return Status; } - ScsiDiskDevice->Signature = SCSI_DISK_DEV_SIGNATURE; - ScsiDiskDevice->ScsiIo = ScsiIo; - ScsiDiskDevice->BlkIo.Revision = EFI_BLOCK_IO_PROTOCOL_REVISION3; - ScsiDiskDevice->BlkIo.Media = &ScsiDiskDevice->BlkIoMedia; - ScsiDiskDevice->BlkIo.Reset = ScsiDiskReset; - ScsiDiskDevice->BlkIo.ReadBlocks = ScsiDiskReadBlocks; - ScsiDiskDevice->BlkIo.WriteBlocks = ScsiDiskWriteBlocks; - ScsiDiskDevice->BlkIo.FlushBlocks = ScsiDiskFlushBlocks; - ScsiDiskDevice->Handle = Controller; + ScsiDiskDevice->Signature = SCSI_DISK_DEV_SIGNATURE; + ScsiDiskDevice->ScsiIo = ScsiIo; + ScsiDiskDevice->BlkIo.Revision = EFI_BLOCK_IO_PROTOCOL_REVISION3; + ScsiDiskDevice->BlkIo.Media = &ScsiDiskDevice->BlkIoMedia; + ScsiDiskDevice->BlkIo.Media->IoAlign = ScsiIo->IoAlign; + ScsiDiskDevice->BlkIo.Reset = ScsiDiskReset; + ScsiDiskDevice->BlkIo.ReadBlocks = ScsiDiskReadBlocks; + ScsiDiskDevice->BlkIo.WriteBlocks = ScsiDiskWriteBlocks; + ScsiDiskDevice->BlkIo.FlushBlocks = ScsiDiskFlushBlocks; + ScsiDiskDevice->Handle = Controller; ScsiIo->GetDeviceType (ScsiIo, &(ScsiDiskDevice->DeviceType)); switch (ScsiDiskDevice->DeviceType) { -- 2.39.2