/** @file\r
This file contains all helper functions on the ATA command \r
\r
- Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
- All rights reserved. This program and the accompanying materials\r
+ Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
//\r
// 48 bit address feature set is supported, get maximum capacity\r
//\r
- Capacity = Atapi6IdentifyStruct->AtapiData.max_user_lba_for_48bit_addr[0];\r
+ Capacity = Atapi6IdentifyStruct->AtaData.maximum_lba_for_48bit_addressing[0];\r
for (Index = 1; Index < 4; Index++) {\r
//\r
// Lower byte goes first: word[100] is the lowest word, word[103] is highest\r
//\r
- TmpLba = Atapi6IdentifyStruct->AtapiData.max_user_lba_for_48bit_addr[Index];\r
+ TmpLba = Atapi6IdentifyStruct->AtaData.maximum_lba_for_48bit_addressing[Index];\r
Capacity |= LShiftU64 (TmpLba, 16 * Index);\r
}\r
\r
//\r
if ((AtaIdentifyData->alignment_logic_in_phy_blocks & 0xc000) == 0x4000) {\r
IdeDev->BlkIo.Media->LowestAlignedLba =\r
- (EFI_LBA) (AtaIdentifyData->alignment_logic_in_phy_blocks & 0x3fff);\r
+ (EFI_LBA) ((IdeDev->BlkIo.Media->LogicalBlocksPerPhysicalBlock - ((UINT32)AtaIdentifyData->alignment_logic_in_phy_blocks & 0x3fff)) %\r
+ IdeDev->BlkIo.Media->LogicalBlocksPerPhysicalBlock);\r
}\r
}\r
//\r