*) minor change
o) optimization
+) feature added
-) something removed
!) fix
!!) critical fix
i) info
e) experimantal


--
2012.07.26 - v0.42c

+) added code for ATAPI BUSY wait auto-adjustment. We poll and measure
BUSY-after-Interrupt delay. Next time we use this value to defere interrupt service
instead of polling.

--
2012.07.26 - v0.42c1

!) undone newer FreeBSD changes in Intel UDMA setup. Caused significant performance degrade on ATAPI.

--
2012.07.27 - v0.42d

!) fixed bug with setting ATAPI flag in AHCI IO flags for non-packet commands on ATAPI devices.

--
2012.07.27 - v0.42d1

!) fixed drive size reporting bug for CHS-only hardware. Was reported as 0,
since UserAddresableBlocks is not valid.

--
2012.07.27 - v0.42d2

!!) fixed bug with concurrent use of InternalSrb by ATAPI internal requests and AHCI internal requests.
Added AhciInternalSrb.

--
2012.07.28 - v0.42d3

!) added code for handling ATAPI on AHCI those generate interrupt,
but do not clear BUSY and do not affect any bit in channel IS register.
We should treat such case as in Native/Legacy ATA mode - just wait for BUSY release.
*) optimized Interrupt disable/enable case in AHCI branch of AtapiDmaReinit() and AtaSetTransferMode()
We shall not touch IE registers if no operaion is required.

--
2012.07.29 - v0.42d4

*) added logs to AHCI ATAPI pre-ready state checks.
!) fixed code for ATAPI BUSY wait auto-adjustment. Delay time was not stored in LunExt properly
+) added internal glabal option MaxIsrWait, which determines ATAPI BUSY wait threshold.
If expected delay is above MaxIsrWait, interrupt service shall be immediately posted to DPC.
It is defaulted to 40us for real hardware and to 200us for VBOX.
Previously shreshold was hardcoded.

--
2012.07.29 - v0.42d5

+) added chglog.txt
+) added ATA_REQ.ahci field to store error status observed in UniataAhciEndTransaction()
*) added logs to  UniataAhciEndTransaction() to study ATAPI completion in more details
*) removed extra logs from AtapiCheckInterrupt__(), added in v0.42d4

--
2012.07.29 - v0.42d5

+) added registry key for MaxIsrWait


--
2012.07.30 - v0.42d6

+) added FBS AHCI register definition (not used now)
+) added IDENTIFY and COMMAND definitions from ATA/ATAPI Command Set 2
+) added SCSI ERASE10 command definition
!) direct access to ATA Command register is replaced with call to AtaCommand() for
AHCI compatibility
*) added check for .Removable flag before sending SCSIOP_MEDIUM_REMOVAL
+) added ByteCount extraction from RFIS for ATAPI devices.

--
2012.07.30 - v0.42e

+) added MODE_SENSE6, Page CACHING support for HDDs
+) added more logs and fixed ByteCount extraction from RFIS for ATAPI devices.

--
2012.07.30 - v0.42e1

*) added setting of DRIVE_SELECT to AHCI ATAPI branch in H2D setup

--
2012.07.31 - v0.42e2

+) added definition of H2D FIS structure
+) added definition of FIS types (codes)
*) clarified definition (size) of ACMD block in IDE_AHCI_CMD and
PFIS, RFIS, SDBFIS in IDE_AHCI_RCV_FIS
*) defined constants for FIS filed offsets IDX_AHCI_i_Xxxx
*) added setting of IDE_DC_A_4BIT to AHCI H2D FIS setup
!) fixed bug with incorrect setting of high-order LBA bits in DriveSelect register for LBA48 commands
(should be 0 since 24-31 bits are stored in BlockNumberExp)
*) used UniataAhciWaitCommandReady() in ATAPI 'Special case' completion to wait for CI release.
*) changed AHCI ready wait granularity to 200 us (was 1 ms) in UniataAhciWaitCommandReady()

--
2012.08.01 - v0.42e3

*) added ACMD dump in UniataAhciBeginTransaction() for ATAPI debug
*) removed (for DEBUG) AHCI prefetch on ATAPI
+) added SACT AHCI register update before CI
*) removed unnecessary CMD register update in UniataAhciBeginTransaction(). ACT+CI is enough
i) analyzed SeaBIOS code v1.7 (http://code.coreboot.org/p/seabios/source/tree/bf079e16f8b0d016eb09787c2aebda359c41391a/src/ahci.c)
*) added ATA_AHCI_P_IX_INF flag to list of allowed interrupts
*) removed unnecessary RtlZeroMemory before UniataAhciSetupFIS_H2D in AHCI ATAPI branch

--
2012.08.01 - v0.42e4

+) (test) DMA-only mode for AHCI ATAPI

--
2012.08.01 - v0.42f

*) (test) DMA-only mode for AHCI ATAPI SCSIOP_REQUEST_SENSE
!) added handling for error-related IS bits. We should restart AHCI engine on all error conditions.
otherwise device comes into indetermined state.
*) adapter max transfer rate is now displayed in atactl -a output

--
2012.08.02 - v0.42f1

*) undone experimental changes with force DMA on AHCI ATAPI (will check later)
*) AHCI abort sequence is moved to UniataAhciAbortOperation()
+) implemented error handling in AHCI StopXxx() calls
*) added use of AHCI ACT register to WaitReady and internal SendCommand

--
2012.08.02 - v0.42f2

+) added support for v12 and v16 READ/WRITE/VERIFY SCSI command emulation.
It extends addressable space to 64bits (v16)
and gives supports for HDDs above 2Tb, they use more than 32bits for LBA.
*) undone all operations with AHCI ACT register

--
2012.08.02 - v0.42g

!) fixed bug with incorrect ATA_AHCI_CMD_WRITE setting in AHCI ATAPI branch.
+) added DMADIR bit support to ATAPI

--
2012.08.02 - v0.42g1

*) (test again) DMA-only mode for AHCI and SATA ATAPI
!) fixed command version specific LBA decoding in IdeReadWrite

--
2012.08.03 - v0.42g2

*) fixes in LBA logging

--
2012.08.03 - v0.42g3

*) reduced amount of logs in AtapiCheckRegValue()
!) fixed bug with 0 number of luns (in log only) in AtapiSetupLunPtrs()
*) added logs to find why on some ICHxxx debug version with attached debugger crashes
on controller reset

--
2012.08.04 - v0.42g4

*) added log to catch damaged Chan pointer in DeviceExtension (observed on Reset in Native/Legacy mode on ICHxxx)
!) added handler for 'unexpected' ATAPI READY interrupt.
*) added small delay after ATAPI PIO read, finished with BUSY status when all requested bytes are transferred.
If BUSY is released, command is assumed to be completed, otherwise further processing is posted to DPC.
+) added SCSIOP_SERVICE_ACTION16/SCSIOP_SA_READ_CAPACITY16 support

--
2012.08.04 - v0.42g5

*) added logs to catch damaged (zero-filled) CDB on AHCI ATAPI READ
*) removed unnecessary FIS logs from UniataAhciEndTransaction()
!) fixed bug with unconditional ERROR state on AHCI ATAPI with zero transfer.

--
2012.08.05 - v0.42g6

*) SrbExtensionSize = sizeof(ATA_REQ) regardless of controller type (test)

--
2012.08.05 - v0.42g7

*) ATA_AHCI_CMD_PREFETCH is used again (test)

--
2012.08.05 - v0.42h

!) fixed bug with missed call to MapError for AHCI ATAPI
!) fixed bug with reading error status from improper place in AHCI ATAPI branch

--
2012.08.06 - v0.42h1

*) several fixes for making compilers happy

--
2012.08.07 - v0.42h2

*) several fixes for making compilers happy
!) clarified use of SRB_STATUS_DATA_OVERRUN in AHCI branch

--
2012.08.07 - v0.42i

!) fixes for SATA TransferRate report/detect
*) added auto-update of controller MaxTransferMode according to actual established SATA transfer rate.
This is done for incorrectly claimed controllers,
+) added AHCI controller max. transfer rate detect.

--
2012.08.07 - v0.42i1

*) several fixes for making compilers happy

--
2012.08.07 - v0.42i2

!) fix for uninitialized DMA PRD in SATA ATAPI branch
*) added more logs to find why on some ICHxxx debug version with attached debugger crashes
on controller reset (chan pointer gets damaged)

--
2012.08.08 - v0.42i3

!) fixes for SATA speed reporting and representation. Doesn't affect actual interface speed.
!) added minimum buffer size check in UNIATA IOCTL. TODO: perform such check in each IOCTL branch.

--
2012.08.09 - v0.42i4

*) minor update in AtapiSoftReset timings, need to fix problem with possible late BUSY after RESET.

--
2012.08.09 - v0.42j

*) artificially broken to cause BusReset and find where chan pointer gets damaged

--
2012.08.09 - v0.42i5

!) rewrittem code for SRB_STATUS_DATA_OVERRUN reporting. Now check is performed in single place
on CompleteRequest.
*) transfer mode reporting is updated

--
2012.08.09 - v0.42i6

+) added PhyMode to LunExt and GETMODE. This value reflects actual bus transfer rate. Is used by atactl.
*) rewritten OrigTransferMode behavior. Now it exactly reports maximum supported by device transfer rate.
*) Ident -> MaxTransferMode code is moved to atapi.h and commonly used in both uniata and atactl
*) transfer rate definition constants are moved to atapi.h

--
2012.08.09 - v0.42i7

*) added zero-filling of output buffer in atactl before calling IOCTL

--
2012.08.11 - v0.43

+) added buffer size check to all UniATA IOCTLs
*) added channel info option to AdapterInfo IOCTL
!) fixed bug with Physical/Logical channel numbering for Legacy controllers in
AtapiChipInit()
*) clarified HwRes check code (80-pin detection)
+) channel transfer mode reporting to atactl -lx for controllers those have physically different channels

--
2012.08.11 - v0.43a

!) fixed bug with buffer overflow in AdapterInfo IOCTL
!) removed via_cable80(), since it doesn't actually work
!) fixed bug with wrong channel info offset in AdapterInfo IOCTL

--
2012.08.12 - v0.43a1

!) fixed bugs with AdapterInfo IOCTL handling
+) experimental ATA_PASS_THROUGH handling for AHCI

--
2012.08.14 - v0.43b

+) added AHCI enable code for chipsets, those have GHC_AE disabled by default
+) added MSI reset workaround code.
*) MaxTransferMode is now checked against channel-specific value
instead of controller-specific one
*) merged ICH7 related updates from FreerBSD, e.g. operations with 0x94 DWORD register
and SATA BAR+0x0C DWORD register
*) removed unnecessary I1CH flag, indicating single channel controllers

--
2012.08.16 - v0.43c

+) implemented SCSIOP_START_STOP_UNIT Immediate, StartStop flag and PowerCondition handling.
ATA IDLE, SLEEP (power down) and STANDBY (stop spindel) commands are used.
Device is returned from Sleep stete via HardReset
PowerState variable is added to LunExt to track expected power state of the device.
*) merged atactl compiler warning fixes from ReactOS (bug 7243)
*) changed intel 40/80-pin cable check

--
2012.08.16 - v0.43c1

+) added AdvancedPowerMode registry option.
0 - disable
1 - min perf with standby
0x80 - min perf. w/o standby
0xfe - max performance (default)
+) added AcousticMgmt registry option
0 - disable
0x80 - min acoustic level
0xfe - max performance (default)
+) added IDLE/STANDBY timer init
Note: some devices have non-zero default timer value (used when timer is disabled).
Value of 0xfd is recommended in such case (max. possible, between 8 and 12 hours, vendor spec.)

--
2012.08.17 - v0.43c2

!) fixed bug with possible crash when chan pointer becomes NULL in AtapiStartIo.
Happened when smartctl (from smartmontools) send IDENTIFY to non-existent or communication channel.
!) fixed bug with improper device type check in ATA_PASS_THROUGH branch (checked for SATA instead of AHCI).
This caused crash with smartctl
!) fixed bug with 40/80-pin cable check on drives those do not report valid HwRes
*) updates (clarification) of DriveNumber meaning in SMART/IDENTIFY IOCTLs

--
2012.08.18 - v0.43c3

!) fixed bug with confused Active and Supported modes from IDENTIFY. Bug caused drive to be limited to BIOS-selected
transfer rate instead of maxumum available.
*) implemented adaptive algorithm of handling DriveNumber in SMART IOCTLs to make smartctl happy.
When invalid PathId/TargetId comes, if adapter has only 1 channel is is treated as primary or secondary IDE.
Otherwise valid PathId/TargetId required.
Note: Due to design bug in DISK.SYS (it doesn't send PathId down for IOCTLs) management tools should
open ScsiPort%d instead of PhysicalDrive%d when possible and send IOCTL to proper SCSI address.

--
2012.08.18 - v0.43c4

*) implemented IDENTIFY checksum adjustment to make smartctl happy
+) added power management options to atactl
o) completly rewritten and unified SCSI address extraction code in SMART IOCTLs

--
2012.08.18 - v0.43c5

!) fixed bug with reference to uninitialized chan pointer in SCSI address extraction code in SMART IOCTLs
+) added new SMART IOCTLs to make smartctl happy (used for SCT):
 IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTO_OFFLINE
 IOCTL_SCSI_MINIPORT_READ_SMART_LOG
 IOCTL_SCSI_MINIPORT_WRITE_SMART_LOG
+) buffer size check to SMART IOCTLs

--
2012.08.19 - v0.43c6

*) AdvancedPowerMode and AcousticMgmt are defaulted to max power saving without standby
!) added validation code for Intel IDE I/O Config Register 0x54.
Older controllers do not use it to reflect cable type

--
2012.08.19 - v0.43d

!) changed Intel DMA setup code in order to handle standard modes correctly (according to specs).
+) added special case for pseudo-UDMA3 setup on Intel PIIX4e

--
2012.08.20 - v0.43d1

!) fixed bug in AHCI ATA registers dump (invalid bit shift for CylHigh)
o) unified ATA registers dump code (used in SMART and ATA PASSTHROUGH).
+) added buffer size check to ATA PASSTHROUGH dump registers branch
+) added check for CDB16 support (via IDENTIFY) and for requested CdbLength
o) extra (unexpected) data wait in AtapiSendCommand in replaced with call to 
AtapiSuckDataPort2()
+) added MODE_SENSE MODE_PAGE_POWER_CONDITION

--
2012.08.23 - v0.43d2

!) fixed bug with uninitialized chan->MaxTransferMode for VIA VT6421 PATA channel
(was set to SA150 according to controller default)
*) added logging of reported interrupt info in UniataFindBusMasterController()
*) allowed 64-bit physical addresses for controllers with AHCI 64-bit support (experimental)

--
2012.08.25 - v0.43d3

!) fixed bug with device addressing for SMART/IDENTIFY on AHCI

--
2012.08.25 - v0.43d4

!) fixed uninitialized MemIo in UniataAhciDetect()
*) pre-initialized 'status' in IdeSendCommand() to make compiler happy,
other similar minor changes
e) AltInit is not issued if HwInitialize() is called in context of ScsiPortInitialize() and we are sure about
detect status under w2k+

--
2012.08.26 - v0.43e

*) InterruptMode is set explicitly to LevelSensetive for PCI controllers (since LevelSensetive == 0, 
was used by default)
e) BM range for MasterDev (Legacy) controllres in not reported to ScsiPort via ConfigInfo
*) adjusted setting of ConfigInfo options according to actual needs

--
2012.08.26 - v0.43e1

e) BM range for MasterDev (Legacy) controllres in not reported to ScsiPort via ConfigInfo
(fixed, didn't work)
*) logged PCI devices using 14 and 15 IRQ (conflicting with ISA ATA)

--
2012.08.27 - v0.43e2

*) fixed PIIX3/PIIX4 device names
*) in XP .INFs %12% is replaced with %10%\System32\drivers, this fixes problem with 'Invalid INF section'
+) added uata_comm.inf for UniATA virtual communication port

--
2012.08.28 - v0.43e3

e) Legacy IDE IO ports are now queried from Isa bus. PCIBus was used before.
*) atactl can now display device info even if ATA/ATAPI identify failed, SCSI INQUIRY is used instead.

--
2012.08.29 - v0.43e4

+) added SCSIOP_REPORT_LUNS support for newer OSes
e) uncommented code for  fake controller to PCI part of Legacy IDE
This is done to prevent system and/or other drivers from deinitializing
PCI part of Legacy IDE
(hangs)

--
2012.08.29 - v0.43e5

e) fake BM controller is inited with 1 bus and 1 lun (was all zeros)
*) PCI IO enable code is moved to separate function since it is used in multiple places

--
2012.08.29 - v0.43e6

!) fix in device identification for fake PCI BM

--
2012.08.29 - v0.43e7

e) temporary disabled call to UniataEnableIoPCI() on Fake claim
(fails)

--
2012.08.29 - v0.43e8

e) disabled Fake claim again

--
2012.08.29 - v0.43e9

e) re-enabled Fake claim
e) used NULL HwInterrupt
(fails)

--
2012.08.29 - v0.43f

*) removed Fake claim
+) added UniataEnableIoPCI() to AtapiChipInit() in global branch for w2k+

--
2012.08.30 - v0.43f1

e) added UniataClaimLegacyPCIIDE() to claim Legacy PCI IDE with 
HalAssignSlotResources
(fails)
*) SCSIOP_REPORT_LUNS is emulated for HDD only

--
2012.08.30 - v0.43f2

!) added UniataClaimLegacyPCIIDE() is called BEFORE attempts to init Isa+PCI
it works
!) BM IO ranges are no longer reported with ISA parts.
TODO: check if Fake claim works if called before ISA.

--
2012.08.30 - v0.43f3

e) check if Fake claim works if called before ISA.
(doesn't work, Scsiport returns STATUS_DEVICE_DOES_NOT_EXIST)

--
2012.08.31 - v0.43f4

!!) reverted to UniataClaimLegacyPCIIDE(), this fixes resource conflict with other PCIIDE drivers

--
2012.08.31 - v0.43f5

!) fixed uata_comm.inf, now it works
*) if PCI part cannot be acquired, controller is initialized in legacy ISA way without DMA

--
2012.09.18 - v0.44

!) fixed LogToDisplay by KtP
*) changed VendorString definition to make newer compilers and cove checkers happy
*) made an attempt to change .mak file and fix build problems after clean or build errors

--
2012.09.20 - v0.44a

!) UniataEnableIoPci doesn't touch PCI Command reg. if it is not necessary (no update required),
because on some systems (e.g. some ICH7) may produce interrupt storm.

--
2012.09.22 - v0.44b

*) fixed bug with access to non-existent Lun in interrupt cleaning on init in PROBE_ON_INIT branch
+) added interrupt cleaning code for !PROBE_ON_INIT branch
+) added ICH7-specific SATA register access

--
2012.09.24 - v0.44b1

!) fixed .mak file (.res rebuild)
*) experimental fix for SATA ATAPI, those do not interrupt after DMA packet command error
(check for error immediately after sending packet)

--
2012.09.24 - v0.44b2

*) experimental fix for SATA ATAPI, check for DRQ (appeared, it is not not asserted on error)

--
2012.09.25 - v0.44b3

*) removed experimental DMA-only mode for SATA ATAPI. Some devices hangs.

--
2012.10.06 - v0.44b4

*) fixed DMA->PIO condition in AtapiDmaInit() for non-AHCI SATA devices (was never switched)

--
2012.12.26 - v0.44c

*) added more logs in AtapiSendCommand() to study error conditions after
previous cmd execution failure. Now next command also treated as failed under VPC
since ERR bit and Error Code is not cleared after PACKET command
*) added call to BuildRequestSenseSrb() after immediately failed ATAPI command,
I hope this will clear error status properly.

--
2012.12.28 - v0.44c1

!) fixed IDE interrupt reason processing bug. Appeared due to mistake during replacement of
numeric values with constants.


--
2012.12.29 - v0.44c2

!) added INF patches by Gerhard Wiesinger, should fix problems with paths to binaries during setup.

--
2012.12.30 - v0.44c3

*) implemented smart BUSY up/down wait algorithm in AtapiSoftReset().
It should avoid unnecessary 1 second delay.

--
2013.03.20 - v0.44c4

!) fixed bug with incorrectly (-1) initialized deviceExtension->MaxTransferMode
in UniataChipDetect() for SIS 961
!) fix candidate for unhandled Write PIO completion. Counters were not updated, this caused
'incomplete transfer' condition and unnecessary endless retry attempts.
