Changeset 33540 in vbox for trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/VBoxIdeBusDxe/Ata.c
- Timestamp:
- Oct 28, 2010 9:27:05 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/VBoxIdeBusDxe/Ata.c
r33027 r33540 30 30 @par Revision Reference: 31 31 2002-6: Add Atapi6 enhancement, support >120GB hard disk, including 32 update - ATAIdenti ty() func32 update - ATAIdentify() func 33 33 update - AtaBlockIoReadBlocks() func 34 34 update - AtaBlockIoWriteBlocks() func … … 51 51 @retval EFI_SUCCESS The disk specified by IdeDev is a Atapi6 supported one and 52 52 48-bit addressing must be used 53 @retval EFI_UNSUPPORTED The disk do sn't not support Atapi6 or it supports but the53 @retval EFI_UNSUPPORTED The disk doesn't not support Atapi6 or it supports but the 54 54 capacity is below 120G, 48bit addressing is not needed 55 55 @retval EFI_DEVICE_ERROR The identify data in IdeDev is incorrect … … 85 85 if ((Atapi6IdentifyStruct->AtapiData.cmd_set_support_83 & BIT10) == 0) { 86 86 // 87 // The device do sn't support 48 bit addressing87 // The device doesn't support 48 bit addressing 88 88 // 89 89 return EFI_UNSUPPORTED; … … 575 575 576 576 // 577 // used to record bytes of currently transfer ed data577 // used to record bytes of currently transferred data 578 578 // 579 579 WordCount = 0; … … 1141 1141 Protocol, supporting ATA/ATAPI-6 standard 1142 1142 1143 Comparing with ATA-3 data in protocol, we have two differen ts here:1143 Comparing with ATA-3 data in protocol, we have two differences here: 1144 1144 1. Do NOT wait for DRQ clear before sending command into IDE device.(the 1145 1145 wait will frequently fail... cause writing function return error) 1146 1146 1147 2. Do NOT wait for DRQ clear after all data read ed.(the wait greatly1147 2. Do NOT wait for DRQ clear after all data read.(the wait greatly 1148 1148 slow down writing performance by 100 times!) 1149 1149 … … 1154 1154 @param AtaCommand value of the Command Register 1155 1155 @param StartLba the start LBA of this transaction 1156 @param SectorCount the count of sectors to be transfer ed1156 @param SectorCount the count of sectors to be transferred 1157 1157 1158 1158 @retval EFI_SUCCESS send out the ATA command and device send required data successfully. … … 1197 1197 1198 1198 // 1199 // Wait for DRDY si ngnal asserting. ATAPI device needn't wait1199 // Wait for DRDY signal asserting. ATAPI device needn't wait 1200 1200 // 1201 1201 if ( (IdeDev->Type == IdeHardDisk) || … … 1259 1259 1260 1260 // 1261 // used to record bytes of currently transfer ed data1261 // used to record bytes of currently transferred data 1262 1262 // 1263 1263 WordCount = 0; … … 1640 1640 // 1641 1641 // SectorCount is used to record the number of sectors to be read 1642 // Max 65536 sectors can be transfer ed at a time.1642 // Max 65536 sectors can be transferred at a time. 1643 1643 // 1644 1644 NumberOfBlocks = MaxDmaCommandSectors; … … 2005 2005 // 2006 2006 // SectorCount is used to record the number of sectors to be read 2007 // Max 65536 sectors can be transfer ed at a time.2007 // Max 65536 sectors can be transferred at a time. 2008 2008 // 2009 2009 SectorCount = 0xffff; … … 2125 2125 if (IdeBlkIoDevice->Type == Ide48bitAddressingHardDisk) { 2126 2126 // 2127 // For ATA/ATAPI-6 device(cap city > 120GB), use ATA-6 read block mechanism2127 // For ATA/ATAPI-6 device(capacity > 120GB), use ATA-6 read block mechanism 2128 2128 // 2129 2129 if (IdeBlkIoDevice->UdmaMode.Valid) { … … 2155 2155 PIO Data Out Protocol, supporting ATA/ATAPI-6 standard 2156 2156 2157 Comparing with ATA-3 data out protocol, we have two differen ts here:<BR>2157 Comparing with ATA-3 data out protocol, we have two differences here:<BR> 2158 2158 1. Do NOT wait for DRQ clear before sending command into IDE device.(the 2159 2159 wait will frequently fail... cause writing function return error) 2160 2160 2161 2. Do NOT wait for DRQ clear after all data read ed.(the wait greatly2161 2. Do NOT wait for DRQ clear after all data read.(the wait greatly 2162 2162 slow down writing performance by 100 times!) 2163 2163 … … 2168 2168 @param AtaCommand value of the Command Register 2169 2169 @param StartLba the start LBA of this transaction 2170 @param SectorCount the count of sectors to be transfer ed2170 @param SectorCount the count of sectors to be transferred 2171 2171 2172 2172 @retval EFI_SUCCESS send out the ATA command and device receive required … … 2212 2212 2213 2213 // 2214 // Wait for DRDY si ngnal asserting.2214 // Wait for DRDY signal asserting. 2215 2215 // 2216 2216 Status = DRDYReady (IdeDev, ATATIMEOUT); … … 2266 2266 2267 2267 // 2268 // used to record bytes of currently transfer ed data2268 // used to record bytes of currently transferred data 2269 2269 // 2270 2270 WordCount = 0; … … 2397 2397 // 2398 2398 // SectorCount is used to record the number of sectors to be written. 2399 // Max 65536 sectors can be transfer ed at a time.2399 // Max 65536 sectors can be transferred at a time. 2400 2400 // 2401 2401 SectorCount = 0xffff; … … 2512 2512 if (IdeBlkIoDevice->Type == Ide48bitAddressingHardDisk) { 2513 2513 // 2514 // For ATA/ATAPI-6 device(cap city > 120GB), use ATA-6 write block mechanism2514 // For ATA/ATAPI-6 device(capacity > 120GB), use ATA-6 write block mechanism 2515 2515 // 2516 2516 if (IdeBlkIoDevice->UdmaMode.Valid) {
Note:
See TracChangeset
for help on using the changeset viewer.