xref: /reactos/drivers/storage/ide/uniata/todo.txt (revision 7115d7ba)
11.  use ScsiPortGetBusData() instead of HalGetBusData() to enumerate    ...
2    PCI devices                                                        (8b )
32.  create 2 channels on non-primary HBA                               (9  )
43.  add BusMaster detection to ISA & ISA/PCI FindController() routines  ...
5    I've decided to modify AtapiFindBusMasterController() for this      ...
6    purpose                                                            (9  )
74.  beautify sources ;)
85.  add LBA support                                                    (8  )
96.  return modified Cylinders in IDENTYFY_DATA to handle HDDs > 8Gb     ...
10    properly                                                           (8  )
117.  return good HDD size value for                                      ...
12    a) IdeVerify()                                                     (8  )
13    b) SCSIOP_READ_CAPACITY                                            (8  )
148.  use READ_NATIVE_SIZE command to determine actual drive capacity    (8a )
159.  send FLUSH command to device                                       (9  )
1610. check (IO_WDx - 0x08) ports in AtapiFindBusMasterController()      (+++)
1711. use SelectDrive() instead of ScsiPortWritePortXXX()                (9a )
1812. remove obsolete AtapiFindPCIController()                           (9a )
1913. make a separate routine AtapiInitController() for HBA               ...
20    initialization (move there some parts of code from                  ...
21    AtapiFindBusMasterController()                                     (---)
2214. add feature enabling code to drive (re)init routine IdeHardReset()  ...
23    AtapiHwInitialize() does all necessary staff                       (10+)
2415, use AtapiInitController() in AtapiHwInitialize()                   (---)
2516. remove obsolete FindBrokenController() and                          ...
26    AtapiFindNativeModeController()                                    (10 )
2717. move FindDevices() to id_probe.cpp                                 (10 )
2818. set HDD PIO modes if no DMA available                              (10 )
2919. implement AtaCommand()                                             (10 )
3020. implement AtaPioMode() & AtaPio2Mode()                             (10 )
3121. add some new ChipSets support from FBSD 4.5                        (10a)
3222. set Controller PIO timigs                                           ...
33    a) via                                                             (11 ) ??
34    b) intel                                                           (+++)
35    c) AcerLabs Aladdin IV/V                                           (23 )
3623. update Identify block                                              (11 )
3724. add LBA-48 support                                                 (11 )
3825. use AtapiCommand()/AtapiCommand48() instead of direct port I/O      ...
39    a) for Read/Write/Identify                                         (11 )
40    b) Set features, Smart, Set drive params                           (11c)
4126. port/implement AtapiDmaInit() for well-known controllers           (11 )
4227. Beautify IdeReadWrite()                                            (11c)
4328. port/implement DMA-specific parts of interrupt handlers            (12 )
4429. request queueing                                                   (16b)
4530. port/implement DMA-start routine                                   (12 )
4631. remove MODE_SENSE/SELECT 6<->10 translation. It'll improve          ...
47    performance.                                                       (11a)
4832. move InterruptService to DPC (via ScsiPortNotification())          (17 )
4933. implement ATA_WAIT_INTR branch in AtapiCommand()/AtapiCommand48()  (11b)
5034. fix bugs in Identify structure                                     (11b)
5135. use normal Lba detection in IssueIdentify()                        (11b)
5236. fix bug with default structure elements alignment                   ...
53    use pragma pack (1)                                                (11c)
5437. use ATA_WAIT_INTR in IdeReadWrite() for Write branch and            ...
55    ATA_IMMEDIATE for Read one                                         (11c)
5638. update Identify dtructure                                          (11c)
5739. fix some size detection bugs in IssueIdentify()                    (11c)
5840. don't forget setting ExpectingInterrupt flag before WriteBuffer()   ...
59    on PIO transfer                                                    (12g)
6041. try generic DMA for old devices instead of PIO default             (12g)
6142. clear 4 lower bits of AccessRange                                  (12g)
6243. reconstruct _Original_ ConfigInfo (not temporary) on Detect         ...
63    phase                                                              (13 )
6444. set 32-bit addressing for all bus types                            (13 )
6545. handle invalid address value (-1) in AtapiDmaSetup()               (13 )
6646. add some new ChipSets support from FBSD 4.6                        (13c)
6747. add 'offset' parameter to AtapiGetIoRange() to allow claiming       ...
68    different io-regions of the same PCI device by different            ...
69    DeviceObjects (representing different channels of this device      (13a)
7048. claim both BusMaster io-regions on SimplexOnly controllers         (+++)
7149. add ATAPI DMA support                                              (19 )
7250. read 'PSS ID Number: Q133706' in NT DDK & implement Registry-       ...
73    supplied params. Use a small hack instead: Argument2 is the         ...
74    pointer to UNICODE_STRING we need                                  (18a)
7551. implement Reinitialize functionality                               (+++)
7652. optimize DMA init (move similar parts of code to loops/functions    ...
77    a) VIA/AMD/nVidia                                                  (13c)
78    b) Promise TX2                                                     (13c)
79    c) Promise Ultra                                                   (23 )
80    d) ServerWorks                                                     (23 )
81    e) CMD 64x                                                         (+++)
82    f) SiS                                                             (+++)
83    g) AcerLabs Aladdin IV/V                                           (+++)
84    h) Intel                                                           (+++)
85    i) Sil                                                             (23 )
86    j) HPT                                                             (23 )
8753. use LogicalUnitExtension instead of xxx[Srb->TargetId]             (14 )
8854. use SrbExtension to manage queue                                   (16b)
8955. IdeReadWrite() should support non-zero initial offset in DataBuffer ...
90    to allow scatter/gather simulation, queueing & retries
9156. keep 'dma_tab' in SrbExtension                                     (16b)
9257. never set SpecificLuExtensionSize to 0                             (14a)
9358. never call ScsiPortGetUncachedExtension() twice for the same HBA,   ...
94    even if the 1st call failed. Use deviceExtension->HbaCtrlFlags &    ...
95    HBAFLAGS_DMA_DISABLED to indicate such case                        (16 )
9659. set deviceExtension->BaseIoAddressBM[1] properly for dual-channel   ...
97    HBAs (it was equal to BaseIoAddressBM[0])                          (16 )
9860. set Channel properly in AtapiInterrupt__() for dual-channel HBAs    ...
99    (lChannel was ignored)                                             (16 )
10061. initialize ConfigINfo members required by                           ...
101    ScsiPortGetUncachedExtension() _before_ call to AtapiDmaAlloc()    (16 )
10262. move SCSI-address-2-Channel/Device translation to macros. This      ...
103    makes code more readable & flexible.                               (16 )
10463. implement SCSI-bus - IDE-channel and                                ...
105    SCSI-TargetId - IDE-master/slave correspondance (using p.62)       (16 )
10664. set AutoRequestSense to TRUE                                       (16a)
10765. set inquiryData->CommandQueue to 1                                 (16a)
10866. fill SenseInfoBufer in                                              ...
109    a) IDE MapError()                                                  (16a)
110    b) IDE/ATAPI success                                               (20d)
11167. use AtaReq->ReqState to indicate request processing state          (16b)
11268. fill AtaReq->ReqState in all necessary places to reflect actual     ...
113    request state (for optimizer)                                      (18+)
11469. fix bug with unconditional returning FALSE in AtapiInterrupt()     (16c)
11570. copy pointer to original AtaReq from Srb to InternalSrb            (16c)
11671. check input Srb value for NULL in AtapiRemoveRequest()             (16c)
11772. return from IssueIdentify loop if no error occured. Previous        ...
118    versions have a bug: SUCCESS status was ignored & this caused       ...
119    obsolet retries                                                    (16c)
12073. clear CTRFLAGS_INTR_DISABLED flag in AtapiEnableInterrupts_Xxx()   (17a)
12174. use Sync Object to manage access to request queue                  (---)
12275. remove AtapiEnableInterrupts_Xxx()-related code duplicates from     ...
123    AtapiInterrupt__()                                                 (17a)
12476. check calls to AtapiResetController() & related routines.           ...
125    See p. 80, 81                                                      (+++)
12677. use ScsiPortNotification() with RequestTimerCall instead of         ...
127    CallDis(En)ableInterrupts to allow servicing 2 channels in          ...
128    parallel. See p.87                                                 (---)
12978. do not use DPC ISR for fast operations, like                        ...
130    a) DMA-completion                                                  (18 )
131    b) sending CDB to ATAPI devices                                    (18a)
132    c) short ATAPI transfers                                           (18a)
13379. call both AtapiEnableInterrupts_X() & AtapiCallBack_X() on DSC      ...
134    restrictive commands completion                                    (18 )
13580. invoke AtapiStartIo__() from ISR as callback to parform it's        ...
136    execution at lower IRQL                                            (19x)
13781. invoke AtapiResetController() from ISR as callback to parform it's  ...
138    execution at lower IRQL                                            (19x)
13982. do not use ScsiPortCompleteRequest() in AtapiResetController()      ...
140    Use standard completion way with setting SenseData instead         (18a)
14183. reset single channel on normal (non-simplex-only) controllers in    ...
142    AtapiResetController()                                             (18a)
14384. sort records in BMList on enumeration phase & simplify init loops   ...
144    in DriverEntry()                                                   (18a)
14585. fix bug with wrong numberChannels init for 2nd channel in           ...
146    AtapiResetController()                                             (18b)
14786. implement channel-sensetive AtapiHwInitialize__() and use in in     ...
148    AtapiResetController() & AtapiHwInitialize()                       (18+)
14987. Due to SCSI-port restrictions we should Enable/Disable interruptys  ...
150    for BOTH channels :((((. Implement this....                        (19 )
15188. Deprecate p.87. ;) It doesn't work. Solution: connect manually      ...
152    created DeviceObject to the same interrupt & check in its ISR if    ...
153    our device interrupted while original ISR/DPC processing            ...
154    another channel's interrupt.                                       (20 )
15590. add error handling on additional DevObj init                       (20a)
15691. deprecate p.80,81. We should acquire QueueSpinLock at DIRQL        (+/-)
15792. perform all possible request init on queueing stage even if we      ...
158    can't send it to device immediately (use CMD_ACTION_XXX)            ...
159    a) for IDE branch                                                  (20c)
160    b) for ATAPI branch                                                (21a)
16193. complete the following commands immediately:                        ...
162    SCSIOP_INQUIRY, SCSIOP_READ_CAPACITY, SCSIOP_REQUEST_SENSE         (20c)
16394. implement ABORT_COMMAND functionality                              (20d)
16495. reorder incoming requests in AtapiQueueRequest()                   (21c)
16596. make 2 modes for ResetController(): complete current & complete     ...
166    all for p.94.                                                      (20d)
16797. store queue size statistics in HW_CHANNEL                          (20d)
16898. remove obsolete DPC code from AtapiInterrupt__()                   (20e)
16999. store error rate in HW_CHANNEL                                     (20e)
170100.try falling back to PIO when DMA error occured                     (20e)
171101.use Dma & Pio error rates to distinguish between BadBlock &         ...
172    BadCable conditions, See also p.127, 128                           (+++)
173102.don't use HDD's algorithm of falling back to PIO for ATAPI         (21 )
174103.clear REQ_FLAG_DMA_OPERATION when falling back to PIO              (21 )
175104.set REQ_FLAG_REORDERABLE_CMD in IdeReadWrite()                     (21 )
176105.store bcount along with lba in ATA_REQ on CMD_ACTION_PREPARE stage (21 )
177106.do like p.105,104 in AtapiSendCommand for read/write ops           (21 )
178107.set operation type flag (Read/Write) in AtaReq on                   ...
179    CMD_ACTION_PREPARE stage                                           (21b)
180108.send comamnds to queue _after_ CMD_ACTION_PREPARE stage            (21a)
181109.fix bug (incorrect queue_size check) in p.108                      (21b)
182110.handle SRB_FLAGS_DISABLE_AUTOSENSE
183111.handle Srb->QueueAction                                            (21d)
184112.check SRB_STATUS_AUTOSENSE_VALID usage policy                      (+++)
185113.add support for hardware queueing/overlapped commands
186114.handle immediate commands properly: don't initiate bus reset        ...
187    while formatting CDRW                                              (+++)
188115.add hardware IDE RAID support
189116.fix bug with data type missmatch in AtapiDmaInit(),                 ...
190    some VIA branches. This bug caused array boundary cross, leading    ...
191    to system crash                                                    (22 )
192117.default udmamode to 0 if there are no well-known devices found      ...
193    in AtapiDmaInit(), VIA branch.                                     (22 )
194118.do not check RevID in AtapiFindDev if RevID == -1                  (22 )
195119.use best settings for newer RevIDs
196120.fix signed/unsigned missmatch (i vs udmamode) in AtapiDmaInit(),    ...
197    VIA branch                                                         (22 )
198121.fix bug with incorrect UDMA init in VIA branch. use UDMA0+i         ...
199    instead of UDMA0+udmamode                                          (22a)
200122.fall back to WDMA mode before PIO                                  (22a)
201123.use transfer speed slowdown algorithm when high error rate          ...
202    detected                                                           (22a)
203124.don't forget updating AtaReq->retry on R/W error (non-DMA)         (22a)
204125.fill AtaReq with ZEROs on TopLevel condition                       (22a)
205126.fix bug in IdeVerify() with sending SectorCount to device before    ...
206    call to AtaCommand48() and using 0 SectorCount in that call        (22a)
207127.store Error/Recover rate statistics in LunExtension                (22a)
208128.use p.127 for smart slowdown algorithm                             (22b)
209129.use lChannel  instead of phChannel for indexing in find-channel     ...
210    loop in AtapiFindBusMasterController()                             (22b)
211130.programm controller for lower speed in Ide/AtapiSendCommand(), not  ...
212    in AtapiInterrupt__()                                              (22b)
213131.use AtapiDmaReinit() routine for p.131                             (22b)
214132.implement per-device queueing                                      (23 )
215134.add Sil, ICH4, Some HPT, PromiseTX2(133) support from 4.7          (23 )
216135.fix wrong bit-shift bug in lba48 branch                            (23 )
217136.update and sort BusMasterAdapters[]                                (23a)
218137.fix bugs in AtapiTimerDpc() that caused incorrect handling of       ...
219    DSC restrictive commands                                            ...
220    a) call ScsiPortNotification(RequestTimerCall, ...) when we had     ...
221       a 2nd request on entry only                                     (23c)
222    b) check HwScsiTimer1 first to decide whether we have to go to      ...
223       GetNextDpc                                                      (23c)
224    c) wrong condition check 'time <= DpcTime1' instead of              ...
225       'time >= DpcTime1'                                              (23c)
226    d) remove request from queue _before_ call to HwScsiTimer()        (23c)
227138.add support for Acard controllers                                  (25 )
228139.use some additional code for HP/Promise Dma Star/Stop              (25 )
229140.assign queueing priority for each device
230141.assign BusMaster io-range to 1st channel only.                     (26e)
231142.do not change bus type to PCI for legacy ISA-PCI controllers under  ...
232    NT4                                                                (28 )
233143.implement Device/Vendor/Rev. filtering via registry keys           (30+)
234144.implement transfer mode control IOCTLs                             (28 )
235145.set max. transfer length > 64k.
236146.implement fix for miss-aligned user buffer
237147.set chip-specific init/operation flags only once during             ...
238    initialization and use them in future. Do not perform multiple      ...
239    bus scans and other detections.                                    (29a)
240148.fix bug with miss-functioning Enable/Disable interrupt for         (+++)
241    secondary channel                                                  (28 )
242149.add serial-ATA support                                             (29a)
243150.add support for new controllers (SiS, Promise)                     (29a)
244151.fix detection/init algorithms in order to avoid usage of            ...
245    non-generic code for unknown chips                                 (29a)
246152.add support for >2 channels                                        (29a)
247153.improve Intr-detection loop. Start each time from next channel      ...
248    for load-balance                                                   (29a)
249154.add support for machines with >4G physical memory                  (38 )
250155.add FreeBSD software RAID support
251156.use http://www.winimage.com/readfi15.zip for performance checks
252157.use IOCTL_SCSI_MINIPORT_IDENTIFY in atactl.exe to determine         ...
253    PIO/DMA when no uniata.sys is installed                            (+++)
254158.implement .INF generator
255159.fix bug with invalid INF section under XP+                         (43e2)
256160.add INF handler for SCSI\NET\VEN_UNIATA&PROD_MANAGEMENT_PORT
257161.